-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
44 lines (38 loc) · 1.58 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
38
39
40
41
42
43
44
name: "actions.checkout-action"
description: "Checks out a private action to ./.github/actions/<owner>/<repo> and outputs this local path as 'path'"
inputs:
repository:
required: true
description: "E.g. <owner>/<repo>"
ssh-key:
required: true
outputs:
path:
description: "The local path of the action to be used for the 'uses: <path>' in your workflow"
value: ${{ steps.local_path_namer_win.outputs.path }}${{ steps.local_path_namer_unix.outputs.path }}
runs:
using: "composite"
steps:
- name: 'Get local path [WIN]'
if: runner.os == 'Windows'
id: local_path_namer_win
shell: powershell
# run: echo "::set-output name=path::./.github/actions/${{ inputs.repository }}"
run: echo "path=./.github/actions/${{ inputs.repository }}" >> $env.GITHUB_OUTPUT
- name: 'Get local path [UNIX]'
if: runner.os != 'Windows'
id: local_path_namer_unix
shell: bash
# run: echo "::set-output name=path::./.github/actions/${{ inputs.repository }}"
run: echo "path=./.github/actions/${{ inputs.repository }}" >> $GITHUB_OUTPUT
# - name: Test
# if: runner.os == 'Windows'
# shell: powershell
# run: echo "TTT- '${{ steps.local_path_namer_win.outputs.path }}${{ steps.local_path_namer_unix.outputs.path }}'"
- name: 'Checkout build action'
uses: actions/checkout@v2
with:
repository: ${{ inputs.repository }}
path: ${{ steps.local_path_namer_win.outputs.path }}${{ steps.local_path_namer_unix.outputs.path }}
ssh-key: ${{ inputs.ssh-key }}
persist-credentials: false