Daily Puzzle Update #463
This file contains hidden or 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: Daily Puzzle Update | |
| on: | |
| schedule: | |
| - cron: "0 8 * * *" | |
| permissions: | |
| contents: write | |
| jobs: | |
| update-puzzle: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v3 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Configure git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Get today's puzzle input | |
| run: bash ./scripts/get-todays-puzzle.sh | |
| - name: Commit changes | |
| run: | | |
| if [ -n "$(git status --porcelain)" ]; then | |
| DATE=$(date -u +'%Y-%m-%d') | |
| git add . | |
| git commit -m "${DATE}: Update Daily Puzzle Input" | |
| git push origin HEAD | |
| else | |
| echo "ERROR: No changes detected." | |
| exit 1 | |
| fi | |