Add SSH support to reusable workflows
This commit is contained in:
18
.github/workflows/python-uv-ci.yml
vendored
18
.github/workflows/python-uv-ci.yml
vendored
@@ -30,6 +30,11 @@ on:
|
||||
test_command:
|
||||
type: string
|
||||
default: "uv run pytest"
|
||||
secrets:
|
||||
ssh_private_key:
|
||||
required: false
|
||||
ssh_known_hosts:
|
||||
required: false
|
||||
|
||||
jobs:
|
||||
quality:
|
||||
@@ -43,6 +48,19 @@ jobs:
|
||||
- name: Checkout
|
||||
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 Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user