feat: Support multiple SSH private keys in Picasso reusable workflow#54
Open
feat: Support multiple SSH private keys in Picasso reusable workflow#54
Conversation
039181f to
4d90900
Compare
|
LGTM! |
Gi-ron
approved these changes
Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Until now, Picasso only supported a single
SSH_PRIVATE_KEYsecret to authenticate against private repositories during the build process.This works well when only one private repository is involved. However, in real-world use cases we increasingly need to:
Since GitHub deploy keys are repository-scoped, a single SSH key is not sufficient in these scenarios.
This PR extends Picasso to support multiple SSH private keys in a clean and backwards-compatible way.
What was implemented
We introduced support for a new optional secret:
SSH_PRIVATE_KEYS(multiline)This secret can contain one or more SSH private keys concatenated together:
Picasso now:
SSH_PRIVATE_KEY(legacy, single key)SSH_PRIVATE_KEYS(multiple keys)This change is fully backwards compatible.
Why this approach
Multiple alternatives were evaluated before deciding on this design.
Alternative considered: fixed number of keys (e.g., 5 slots)
One option was to:
Define multiple secrets in the reusable workflow interface:
SSH_PRIVATE_KEY_1SSH_PRIVATE_KEY_2SSH_PRIVATE_KEY_5Concatenate them internally.
Pros:
Cons:
Alternative considered: dynamically passing secret names
Another idea was to:
However, reusable workflows have important constraints:
workflow_call.secretsor passed viasecrets: inheritWhile GitHub supports some indexed secret access patterns, building a fully dynamic, unbounded secret resolution mechanism inside a reusable workflow becomes complex, and harder to maintain.
In particular:
Why the multiline secret is the cleanest solution
The chosen approach:
SSH_PRIVATE_KEYSImportant note about deploy keys
When using GitHub deploy keys, each key should include the repository SSH URL in its comment:
This allows
webfactory/ssh-agentto correctly associate keys with repositories and avoid authentication failures when multiple deploy keys are loaded.This has been documented in the README update included in this PR.
Impact
This is a minor version feature addition.