-
Notifications
You must be signed in to change notification settings - Fork 285
43 lines (36 loc) · 1.06 KB
/
index-recipes.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
name: Generate Recipes Index
on:
push:
branches:
- "**"
paths:
- "docs/recipes/**"
workflow_dispatch:
jobs:
generate-index:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
run: |
npm install fs-extra
- name: Generate index
run: |
node .github/scripts/generate-index-recipes.js
- name: Commit and push changes
run: |
BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})
if [ -n "$(git status --porcelain)" ]; then
git config --local user.email "[email protected]"
git config --local user.name "Lucee Docs GitHub Action"
git add docs/recipes/index.json docs/recipes/README.md
git commit -m "Update recipes index and README"
git push origin $BRANCH_NAME
else
echo "No changes found to commit"
fi