-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
37 lines (33 loc) · 1.36 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: "Checkout Action"
description: "Cleanup the remaining traces of previous jobs in self hosted runner and checkout the repository"
inputs:
actions-repo:
description: "The private actions repository to checkout in the .github/actions folder"
required: false
default: ""
actions-ssh-key:
description: "The ssh deploy key used to clone the actions private repository"
required: false
default: ""
runs:
using: composite
steps:
- name: Checkout the current repository
uses: actions/checkout@v4
- name: Set variables
if: inputs.actions-repo != '' && inputs.actions-ssh-key != ''
id: actions-set-vars
shell: bash
run: |
repo_basepath=$(echo "${{ inputs.actions-repo }}" | cut -d '@' -f1)
repo_ref=$(echo "${{ inputs.actions-repo }}" | cut -d '@' -f2)
echo "repo-basepath=$(echo ${repo_basepath})" >> $GITHUB_OUTPUT
echo "repo-ref=$(echo ${repo_ref})" >> $GITHUB_OUTPUT
- name: Checkout the actions private repository
if: inputs.actions-repo != '' && inputs.actions-ssh-key != ''
uses: actions/checkout@v4
with:
repository: ${{ steps.actions-set-vars.outputs.repo-basepath }}
ref: ${{ steps.actions-set-vars.outputs.repo-ref }}
path: .github/actions/${{ steps.actions-set-vars.outputs.repo-basepath }}
ssh-key: ${{ inputs.actions-ssh-key }}