Update wcms-modules.json #549
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update wcms-modules.json | |
on: | |
workflow_dispatch: | |
schedule: | |
# Run daily at 3am | |
- cron: '0 3 * * *' | |
jobs: | |
update-wcms-modules: | |
name: Update wcms-modules.json | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
- name: Build wcms-modules.json | |
run: node build-wcms-modules.js | |
- name: Commit result | |
run: | | |
set -e | |
git config user.name github-actions | |
git config user.email [email protected] | |
# Commit only if there has been changes | |
if [[ -n $(git status --porcelain wcms-modules.json) ]]; then | |
git add wcms-modules.json | |
git commit -m "Autoupdate wcms-modules.json" | |
git push | |
else | |
echo "No changes to wcms-modules.json" | |
fi |