-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (31 loc) · 907 Bytes
/
daily-update.yml
File metadata and controls
39 lines (31 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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