-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
37 lines (35 loc) · 1.07 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: True YAML Actions
description: Explodes a YAML specification with anchors and merge keys into a format GitHub Actions understands
branding:
icon: 'maximize-2'
color: 'red'
inputs:
token:
description: 'a token with write access to the repository'
required: true
runs:
using: composite
steps:
- shell: bash
run: |
if [ -z "${{ inputs.token }}" ]; then
echo 'No token set'
exit 1
fi
- uses: actions/checkout@v4.2.2
with:
token: ${{ inputs.token }}
- uses: mikefarah/yq@v4.44.3
id: explode
with:
cmd: |
for target in .github/real-workflows/*; do
yq 'explode(.) | select(di==1)' "$target" > ".github/workflows/${target/.*\/}"
done
- shell: bash
run: |
git config --global user.name "GitHub Actions YAML generator [bot]"
git config --global user.email "yaml.actions.bot@users.noreply.github.com"
git add .github/workflows/
git diff --staged --quiet || git commit -m "ci: regenerate workflows"
git push