-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (39 loc) · 1.11 KB
/
readme-stars.yml
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
39
40
41
42
43
44
name: Update README ⭐
on:
schedule:
- cron: "0 11 * 12 *"
push:
branches:
- main
jobs:
update-readme:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check year for cron
if: github.event_name == 'schedule'
run: |
current_year=$(date +'%Y')
if [ "$current_year" -ne "2024" ]; then
echo "No longer 2024, delete this action's schedule."
exit 1
fi
- name: Check commit message for push
if: github.event_name == 'push'
run: |
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
if ! [[ "$COMMIT_MESSAGE" =~ ^day\ [0-9]{2}$ ]]; then
echo "Commit message does not match solution pattern"
exit 1
fi
- name: Checkout repository
uses: actions/checkout@v4
- uses: k2bd/advent-readme-stars@v1
with:
userId: 4388690
year: 2024
sessionCookie: ${{ secrets.AOC_SESSION }}
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: auto-update README stars