-
-
Notifications
You must be signed in to change notification settings - Fork 37
42 lines (38 loc) · 1.3 KB
/
create-json-list.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
name: create template-list.json
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "templates/**"
pull_request:
types: [closed]
branches:
- main
paths:
- "templates/**"
jobs:
create-json:
if: github.event.pull_request.merged == 'true' || github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.API_KEY20220726 }}
- name: Create templates/template-file-list.json
run: |
cd templates
template_file_list=()
for f in *.yml; do
template_file_list+=("${f/.yml/}")
done
jq -n --arg v "${template_file_list[*]}" '{"templates": $v | split(" ")}' > template-file-list.json
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Automated Change template-file-list.json
file_pattern: templates/template-file-list.json
commit_user_name: My GitHub Actions Bot # defaults to "github-actions[bot]"
commit_user_email: [email protected] # defaults to "github-actions[bot]@users.noreply.github.com"
commit_author: Author <[email protected]> # defaults to author of the commit that triggered the run