Fetch and Commit Docs #36136
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: Fetch and Commit Docs | |
on: | |
schedule: | |
- cron: "*/5 * * * *" | |
jobs: | |
fetch-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- name: Fetch data | |
working-directory: apps/frontend | |
run: | | |
pnpm fetch-data | |
- name: Check for changes | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Action" | |
if [ -n "$(git status --porcelain)" ]; then | |
git add . | |
git commit -m "Update docs" | |
git push | |
else | |
echo "No changes to commit" | |
fi |