Add SSH support to reusable workflows

This commit is contained in:
estebanthi
2026-01-04 16:50:30 +01:00
parent 74bd39fcd3
commit c001f91b5e
3 changed files with 59 additions and 0 deletions

View File

@@ -27,6 +27,11 @@ on:
test_command:
type: string
default: "pnpm test"
secrets:
ssh_private_key:
required: false
ssh_known_hosts:
required: false
jobs:
quality:
@@ -37,6 +42,19 @@ jobs:
- name: Checkout source
uses: actions/checkout@v4
- name: Start ssh-agent
if: ${{ secrets.ssh_private_key != '' }}
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.ssh_private_key }}
- name: Add SSH known hosts
if: ${{ secrets.ssh_known_hosts != '' }}
run: |
mkdir -p ~/.ssh
printf '%s\n' "${{ secrets.ssh_known_hosts }}" >> ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
- name: Set up Node
uses: actions/setup-node@v4
with: