Repository navigation
Conversation
|
I second this! What can I do to move this forward? |
Match the repository URL in the key comment only (not the base64 key), accepting git@<host>:<path>, https://<host>/<path> and ssh://git@<host>[:<port>]/<path> with a dotted host and paths of two or more segments. The host is lowercased and web page suffixes such as /tree/main are dropped. A port is written to the generated ssh Host block. Comments without such a URL are no longer treated as deploy keys, which also fixes the crash in the bundled no-match log message. Write the insteadOf rewrites with execFileSync, add unit tests run by `npm test`, and bump @actions/core to 1.10.0 to match the bundle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On self-hosted runners that share $HOME between jobs, deploy-key insteadOf rewrites written to the global git config by earlier jobs (of any repository, with this action or webfactory/ssh-agent) stay there and point to ssh Host aliases that no longer exist. git prefers them over equally long rewrites of the current job, so clones fail. At startup, remove all deploy-key rewrites from the global git config; this is best effort and only warns on failure. Set the job's rewrites through GIT_CONFIG_COUNT/GIT_CONFIG_KEY_<n>/GIT_CONFIG_VALUE_<n> instead, keeping other entries already set there and replacing the deploy-key rewrites of earlier invocations, whose keys are in an ssh-agent that is no longer used. Deploy keys therefore need git 2.31, which is checked. The post step only stops the agent, as upstream. Build the key file and Host alias names in one place, skip appending an ssh Host section that already exists, and document the limitations of the environment-based settings and the updated Docker build recipe. Test the config handling against git in an isolated config, and add a demo job that plants stale rewrites, runs the action twice and checks what git and ssh resolve on Linux, macOS and Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The clone demos need the deploy keys for upstream's mpdude/test-* repositories, so their steps are skipped where those secrets are not set, as in this fork. generated_keys_demo covers the action without them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…teadof ENG-2598: Set deploy-key rewrites in the job environment, clear stale ones; merge upstream (node24)
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.
This PR makes the regex expression for matching keys to repos more permissive, enabling the use of private github and gitlab servers.