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

Allow the user to override the commands for git, ssh-agent, and ssh-add #154

Merged
merged 4 commits into from Jan 27, 2023
Merged

Allow the user to override the commands for git, ssh-agent, and ssh-add #154

merged 4 commits into from Jan 27, 2023

Conversation

DilumAluthge
Copy link
Contributor

@DilumAluthge DilumAluthge commented Dec 1, 2022

On my self-hosted Windows runners, the git, ssh-agent, and ssh-add commands are not located in the locations that are currently hard-coded in paths.js.

With this PR, I am able to get this action to work on my runners as follows:

- uses: webfactory/ssh-agent@...
  with:
    ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
    git-cmd: git
    ssh-agent-cmd: ssh-agent
    ssh-add-cmd: ssh-add

@DilumAluthge DilumAluthge changed the title Allow the user to override the commands for git, ssh-agent, and ssh-add [WIP] Allow the user to override the commands for git, ssh-agent, and ssh-add Dec 1, 2022
@DilumAluthge DilumAluthge marked this pull request as ready for review December 1, 2022 05:21
@DilumAluthge DilumAluthge changed the title [WIP] Allow the user to override the commands for git, ssh-agent, and ssh-add Allow the user to override the commands for git, ssh-agent, and ssh-add Dec 1, 2022
@DilumAluthge
Copy link
Contributor Author

@mpdude Could you review this?

@DilumAluthge
Copy link
Contributor Author

Bump @mpdude

1 similar comment
@DilumAluthge
Copy link
Contributor Author

Bump @mpdude

@mpdude
Copy link
Member

mpdude commented Jan 13, 2023

LGTM, thanks for the contribution!

For completeness, could you also please document the new inputs at https://github.com/webfactory/ssh-agent#action-inputs?

thanks

@DilumAluthge
Copy link
Contributor Author

For completeness, could you also please document the new inputs at https://github.com/webfactory/ssh-agent#action-inputs?

Done!

@DilumAluthge
Copy link
Contributor Author

Bump @mpdude

index.js Outdated Show resolved Hide resolved
@sebastiankugler
Copy link
Member

@mpdude can we merge this? Looks good to me.

@mpdude mpdude merged commit 6f828cc into webfactory:master Jan 27, 2023
@mpdude
Copy link
Member

mpdude commented Jan 27, 2023

Thanks for your contribution, and sorry for the delay.

@DilumAluthge DilumAluthge deleted the dpa/windows-ssh-agent-path branch January 27, 2023 23:03
@DilumAluthge
Copy link
Contributor Author

No worries, thanks for merging!

And thank you @mpdude and @sebastiankugler for the reviews!

sebastiankugler pushed a commit that referenced this pull request Jan 28, 2023
tkalus added a commit to tkalus-forks/ssh-agent that referenced this pull request May 23, 2023
Bring `post` actions step into consistency with `main` for changes
introduced in webfactory#154

Without this change, `sshAgentCmd` is undefined when passed to
`execFileSync()` and cleanup is never successful.
tkalus added a commit to tkalus-forks/ssh-agent that referenced this pull request May 23, 2023
Bring `post` actions step into consistency with `main` for changes
introduced in webfactory#154

Without this change, `sshAgentCmd` is undefined when passed to
`execFileSync()` during `cleanup` and `post` is never successful.
renovate bot added a commit to valora-inc/wallet that referenced this pull request Aug 11, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [webfactory/ssh-agent](https://togithub.com/webfactory/ssh-agent) |
action | minor | `v0.5.3` -> `v0.8.0` |

---

### Release Notes

<details>
<summary>webfactory/ssh-agent (webfactory/ssh-agent)</summary>

###
[`v0.8.0`](https://togithub.com/webfactory/ssh-agent/releases/tag/v0.8.0):
SSH host keys no longer managed – read below 👇

[Compare
Source](https://togithub.com/webfactory/ssh-agent/compare/v0.7.0...v0.8.0)

Starting with this release, this action no longer writes GitHub's SSH
host keys into the `known_hosts` SSH config file upon start.

GitHub changed their host keys on short notice this morning, see
https://github.blog/2023-03-23-we-updated-our-rsa-ssh-host-key/. We took
this as an opportunity to stop maintaining GH SSH keys in the code
shipped with this action
([#&#8203;171](https://togithub.com/webfactory/ssh-agent/issues/171)).

What you need to do:

- On GitHub hosted runners, nothing. ✔︎ These runners ship with SSH host
keys (for `github.com`) maintained by directly by GitHub.
-   On self-hosted runners, review and fix your SSH `known_hosts` file:
- First, you'll find it bloated with redundant entries for `github.com`,
as described in
[#&#8203;106](https://togithub.com/webfactory/ssh-agent/issues/106).
Remove these entries.
- Review
https://github.blog/2023-03-23-we-updated-our-rsa-ssh-host-key/. You
probably removed the old (invalid) SSH key in the previous step.
- Configure GitHub's current SSH keys as documented on
https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/githubs-ssh-key-fingerprints
- As long as versions before `v0.8.0` of this action here are run on the
self-hosted runner, the old entries will come back. Keep an eye on it,
possibly you'll have to rinse & repeat.

##### Other code changes in this release

- Update to `actions/checkout@v3` by
[@&#8203;mpdude](https://togithub.com/mpdude) in
[webfactory/ssh-agent#143
- Allow the user to override the commands for `git`, `ssh-agent`, and
`ssh-add` by [@&#8203;DilumAluthge](https://togithub.com/DilumAluthge)
in
[webfactory/ssh-agent#154

##### New Contributors

- [@&#8203;prhiggins](https://togithub.com/prhiggins) made their first
contribution in
[webfactory/ssh-agent#153
- [@&#8203;kjarkur](https://togithub.com/kjarkur) made their first
contribution in
[webfactory/ssh-agent#147
- [@&#8203;DilumAluthge](https://togithub.com/DilumAluthge) made their
first contribution in
[webfactory/ssh-agent#154

**Full Changelog**:
webfactory/ssh-agent@v0.7.0...v0.8.0

###
[`v0.7.0`](https://togithub.com/webfactory/ssh-agent/blob/HEAD/CHANGELOG.md#v070-2022-10-19)

[Compare
Source](https://togithub.com/webfactory/ssh-agent/compare/v0.6.0...v0.7.0)

##### Added

- Add the `log-public-key` input that can be used to turn off logging
key identities
([#&#8203;122](https://togithub.com/webfactory/ssh-agent/issues/122))

##### Fixed

- Fix path to `git` binary on Windows, assuming GitHub-hosted runners
([#&#8203;136](https://togithub.com/webfactory/ssh-agent/issues/136),
[#&#8203;137](https://togithub.com/webfactory/ssh-agent/issues/137))
- Fix a nonsensical log message
([#&#8203;139](https://togithub.com/webfactory/ssh-agent/issues/139))

###
[`v0.6.0`](https://togithub.com/webfactory/ssh-agent/blob/HEAD/CHANGELOG.md#v060-2022-10-19)

[Compare
Source](https://togithub.com/webfactory/ssh-agent/compare/v0.5.4...v0.6.0)

##### Changed

- Update the version of Node used by the action from 12 to 16
(https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/).

###
[`v0.5.4`](https://togithub.com/webfactory/ssh-agent/blob/HEAD/CHANGELOG.md#v054-2021-11-21)

[Compare
Source](https://togithub.com/webfactory/ssh-agent/compare/v0.5.3...v0.5.4)

##### Fixed

- Update changed GitHub Host Keys
([#&#8203;102](https://togithub.com/webfactory/ssh-agent/issues/102),
[#&#8203;101](https://togithub.com/webfactory/ssh-agent/issues/101))

##### Changed

-   Various documentation (README) improvements and additions
- Change logging to more precisely state that *public* keys are being
printed

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 5pm,every weekend" in timezone
America/Los_Angeles, Automerge - "after 5pm,every weekend" in timezone
America/Los_Angeles.

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/valora-inc/wallet).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi40MC4zIiwidXBkYXRlZEluVmVyIjoiMzYuNDAuMyIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
tkalus added a commit to tkalus-forks/ssh-agent that referenced this pull request Mar 4, 2024
Bring `post` actions step into consistency with `main` for changes
introduced in webfactory#154

Without this change, `sshAgentCmd` is undefined when passed to
`execFileSync()` during `cleanup` and `post` is never successful.
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.

None yet

3 participants