mirror of
https://github.com/webfactory/ssh-agent.git
synced 2026-03-23 19:49:06 +08:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc588b651f | ||
|
|
204eb35a4e | ||
|
|
9f6f312a31 | ||
|
|
2e59dd7d06 | ||
|
|
fd34b8dee2 |
4
.github/workflows/demo.yml
vendored
4
.github/workflows/demo.yml
vendored
@@ -8,7 +8,7 @@ jobs:
|
|||||||
os: [ ubuntu-latest, macOS-latest, windows-latest ]
|
os: [ ubuntu-latest, macOS-latest, windows-latest ]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Setup key
|
- name: Setup key
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -28,7 +28,7 @@ jobs:
|
|||||||
container:
|
container:
|
||||||
image: ubuntu:latest
|
image: ubuntu:latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- run: apt update && apt install -y openssh-client git
|
- run: apt update && apt install -y openssh-client git
|
||||||
- name: Setup key
|
- name: Setup key
|
||||||
uses: ./
|
uses: ./
|
||||||
|
|||||||
19
README.md
19
README.md
@@ -1,10 +1,9 @@
|
|||||||
# `ssh-agent` GitHub Action
|
# `ssh-agent` GitHub Action
|
||||||
|
|
||||||
This action
|
This action
|
||||||
* starts the `ssh-agent`,
|
* starts the `ssh-agent`,
|
||||||
* exports the `SSH_AUTH_SOCK` environment variable,
|
* exports the `SSH_AUTH_SOCK` environment variable, and
|
||||||
* loads one or several private SSH key into the agent and
|
* loads one or several private SSH key into the agent.
|
||||||
* configures `known_hosts` for GitHub.com.
|
|
||||||
|
|
||||||
It should work in all GitHub Actions virtual environments, including container-based workflows.
|
It should work in all GitHub Actions virtual environments, including container-based workflows.
|
||||||
|
|
||||||
@@ -27,7 +26,7 @@ GitHub Actions only have access to the repository they run for. So, in order to
|
|||||||
* In your repository, go to the *Settings > Secrets* menu and create a new secret. In this example, we'll call it `SSH_PRIVATE_KEY`.
|
* In your repository, go to the *Settings > Secrets* menu and create a new secret. In this example, we'll call it `SSH_PRIVATE_KEY`.
|
||||||
* Put the contents of the *private* SSH key file into the contents field. <br>
|
* Put the contents of the *private* SSH key file into the contents field. <br>
|
||||||
* This key should start with `-----BEGIN ... PRIVATE KEY-----`, consist of many lines and ends with `-----END ... PRIVATE KEY-----`.
|
* This key should start with `-----BEGIN ... PRIVATE KEY-----`, consist of many lines and ends with `-----END ... PRIVATE KEY-----`.
|
||||||
5. In your workflow definition file, add the following step. Preferably this would be rather on top, near the `actions/checkout@v2` line.
|
5. In your workflow definition file, add the following step. Preferably this would be rather on top, near the `actions/checkout@v4` line.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# .github/workflows/my-workflow.yml
|
# .github/workflows/my-workflow.yml
|
||||||
@@ -35,9 +34,9 @@ jobs:
|
|||||||
my_job:
|
my_job:
|
||||||
...
|
...
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
# Make sure the @v0.7.0 matches the current version of the action
|
# Make sure the @v0.9.0 matches the current version of the action
|
||||||
- uses: webfactory/ssh-agent@v0.7.0
|
- uses: webfactory/ssh-agent@v0.9.0
|
||||||
with:
|
with:
|
||||||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
# ... other steps
|
# ... other steps
|
||||||
@@ -52,7 +51,7 @@ You can set up different keys as different secrets and pass them all to the acti
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# ... contents as before
|
# ... contents as before
|
||||||
- uses: webfactory/ssh-agent@v0.7.0
|
- uses: webfactory/ssh-agent@v0.9.0
|
||||||
with:
|
with:
|
||||||
ssh-private-key: |
|
ssh-private-key: |
|
||||||
${{ secrets.FIRST_KEY }}
|
${{ secrets.FIRST_KEY }}
|
||||||
|
|||||||
@@ -20,10 +20,11 @@ inputs:
|
|||||||
description: 'git command'
|
description: 'git command'
|
||||||
required: false
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: 'node16'
|
using: 'node20'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
post: 'dist/cleanup.js'
|
post: 'dist/cleanup.js'
|
||||||
post-if: 'always()'
|
post-if: 'always()'
|
||||||
|
|
||||||
branding:
|
branding:
|
||||||
icon: loader
|
icon: loader
|
||||||
color: 'yellow'
|
color: 'yellow'
|
||||||
|
|||||||
Reference in New Issue
Block a user