-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (36 loc) · 1.12 KB
/
generate_index.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 Index
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches:
- "**"
pull_request:
types: [opened, reopened, synchronize, edited]
jobs:
build:
name: "Generate index and readme"
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
ref: ${{github.head_ref}}
- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
- name: Check committer
id: check
run: |
COMMITTER=$(git log -1 --pretty=format:'%ae')
echo "COMMITTER=$COMMITTER" >> $GITHUB_ENV
- name: Run script
run: php .github/workflows/scripts/generate_index.php
if: env.COMMITTER != '[email protected]'
- name: Commit and push if it changed
run: |
git diff
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -am "Update index.json and README.md" || exit 0
git push