Add github action to build extension list

This commit is contained in:
Alexis Degrugillier 2022-01-09 16:42:50 -05:00
parent 93c042a57d
commit 7ada095fc9
4 changed files with 109 additions and 55 deletions

37
.github/workflows/generate.yml vendored Normal file
View file

@ -0,0 +1,37 @@
name: Generate extension list
on:
schedule:
- cron: '11 11 * * *'
workflow_dispatch: ~
jobs:
build:
runs-on: ubuntu-latest
env:
FILE: extensions.json
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Build JSON file
run: php ./generate.php
- name: Setup git
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Get changes
id: diff
run: |
DIFF=$(git diff --numstat -- $FILE | wc -l)
echo "::set-output name=DIFF::$DIFF"
- name: Commit changes
run: |
git add $FILE
git commit -m 'Update extension list'
git push origin $GITHUB_REF
if: steps.diff.outputs.DIFF != 0