Update Front Matter #71
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 Front Matter | |
on: | |
schedule: | |
- cron: '0 0 */2 * *' # Runs at 00:00 UTC every 2 days | |
jobs: | |
update-front-matter: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: Install Dependencies | |
run: npm install gray-matter glob | |
- name: Update Front Matter in Markdown Files | |
run: node update_frontmatter.mjs | |
- name: Commit changes | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Action" | |
git add -A | |
git diff --staged --quiet || git commit -m "Update front matter tags based on dates" | |
git push |