-
Notifications
You must be signed in to change notification settings - Fork 1
30 lines (30 loc) · 1.06 KB
/
gather_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
# Inspired By https://github.com/J0B10/aoc-badges-action#sample-workflow
name: Gather AOC Stars
on: [push]
jobs:
gather-stars:
runs-on: ubuntu-latest
container:
image: blacktop/httpie
env:
SESSION: ${{ secrets.AOC_SESSION }}
USERID: 1063637
USERAGENT: "User-Agent: HTTPie - https://github.com/pcorliss/advent_of_code/ - pcorliss@gmail.com"
steps:
- name: Download Leaderboards
run: |
for YEAR in `seq 2015 2023`; do
http --download GET https://adventofcode.com/$YEAR/leaderboard/private/view/$USERID.json "$USERAGENT" Cookie:session=$SESSION >> $YEAR.json
done
echo STARS=$(cat *.json | jq ".members[\"$USERID\"].stars" | jq -s '. | add') >> $GITHUB_ENV
- name: Show Stars
run: echo $STARS
- name: Create Awesome Badge
uses: schneegans/dynamic-badges-action@v1.1.0
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 2cc2a13636cb044176c0fa1e7bcf7ec2
filename: aoc_stars.json
label: 'Stars'
message: ${{ env.STARS }}
color: yellow