Convert Activities to JSON #7
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: Convert Activities to JSON | |
on: | |
push: | |
paths: | |
- 'activities.md' | |
# allows to manually run the job at any time | |
workflow_dispatch: | |
jobs: | |
convert: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
- name: Run script | |
run: node ./convert.js | |
- name: Commit and push if changed | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add activities.json | |
if git diff --staged --quiet; then | |
echo "No changes in activities.json" | |
else | |
git commit -m "Update activities.json" | |
git push | |
fi |