Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support GitHub Enterprise servers #163

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cardoe
Copy link

@cardoe cardoe commented Feb 15, 2023

Added support for GitHub Enterprise servers by loosening the restrictions on the hostname portion of the deploy key comment being "github.com" to any hostname and then using that hostname in the rest of the config. Adjusted the regex to match the end of the line since the comment portion is at the end. ref #128 fixes actions/checkout#934

Added support for GitHub Enterprise servers by loosening the
restrictions on the hostname portion of the deploy key comment being
"github.com" to any hostname and then using that hostname in the rest of
the config. Adjusted the regex to match the end of the line since the
comment portion is at the end. fixes #934
@cardoe
Copy link
Author

cardoe commented Mar 7, 2023

I ended up writing my own version of this action because in addition to this feature I've found this action doesn't clean up after itself. There's also no tests in this action. My action is here: https://github.com/marketplace/actions/ssh-agent-deploy-key

@jackbentley
Copy link

@cardoe The action does (or should) cleanup after it's self? There's cleanup.js in the root of the repo which is specified in the action.yml and kills the SSH agent on post. Also, looking at your action, it's writing the SSH keys to disk which somewhat defeats one of the purposes of the SSH agent.

@cardoe
Copy link
Author

cardoe commented Jan 17, 2024

@jackbentley The cleanup only kills the ssh-agent. It doesn't do anything about the changes it made to the worker's home folder. My action also doesn't write the SSH private keys to the disk. It writes the SSH public keys to the disk. Which is identical to what this action does as well, and fails to clean up. Because to be able to have two different SSH deploy keys for two different GitHub repos, you must specify the public key via an on disk file that corresponds to the SSH private key from the ssh-agent to be used.

Here's the link to how this action writes out that file:

fs.writeFileSync(`${homeSsh}/key-${sha256}`, key + "\n", { mode: '600' });

While here's a copy of the cleanup: https://github.com/webfactory/ssh-agent/blob/fd34b8dee206fe74b288a5e61bc95fba2f1911eb/cleanup.js
You can see those written keys are never cleaned up.

@cardoe
Copy link
Author

cardoe commented Jan 17, 2024

To further follow up, I wrote my action after not getting traction in this repo around these issues. There's others getting burned by the broken cleanup as well. See #183 and the comments there.

I'm sure mine has some deficiencies but I'm more than happy to address them and release an update.

@jackbentley
Copy link

@cardoe Thanks for taking the time to write back. I see what you mean about only writing public keys - my mistake. And I agree, this action seems to be a bit dead. We will see what happens when node 16 support is removed 🤷🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot checkout submodules on github.com from a repository on GitHub Enterprise Server
2 participants