-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
58 lines (52 loc) · 1.52 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Link GHA Actions
author: Taylor Perkins
description: Given another repo containing your reusable actions, link them to the current repo with a prefix
inputs:
repository:
description: actions/checkout@v4::repository
required: true
token:
description: actions/checkout@v4::token
required: false
default: ''
ref:
description: actions/checkout@v4::ref
default: 'main'
required: false
prefix:
description: Prefix to use for workflows and actions
default: ''
required: false
runs:
using: composite
steps:
- name: Clone repo
uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}
token: ${{ inputs.token }}
ref: ${{ inputs.ref }}
path: .link-actions
set-safe-directory: false
- run: |
rm -rf ${{ runner.temp }}/.link-actions
mv ${GITHUB_WORKSPACE}/.link-actions ${{ runner.temp }}/.link-actions
shell: bash
- working-directory: ${{ runner.temp }}/.link-actions
id: link
shell: bash
run: |
ls -al .github/actions
if [[ -d .github/actions ]]
then
for p in `find .github/actions -name action.yml`
do
d=$(dirname $p)
mkdir -p "${GITHUB_WORKSPACE}/`dirname $d`"
ln -s "`pwd`/${d}/" "${GITHUB_WORKSPACE}/${d}"
done
# normal
find "${GITHUB_WORKSPACE}/.github/actions" -name action.yml
# links
find "${GITHUB_WORKSPACE}/.github/actions" -type l -ls
fi