2024 Day 12 Part 2 Complete #112
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
# Inspired By https://github.com/J0B10/aoc-badges-action#sample-workflow | |
name: Gather AOC Stars | |
on: [push] | |
jobs: | |
gather-stars: | |
runs-on: ubuntu-24.04 | |
env: | |
SESSION: ${{ secrets.AOC_SESSION }} | |
USERID: 1063637 | |
USERAGENT: "User-Agent: HTTPie - https://github.com/pcorliss/advent_of_code/ - pcorliss@gmail.com" | |
steps: | |
# is jq installed? | |
- name: Download Leaderboards | |
run: | | |
for YEAR in `seq 2015 2024`; do | |
curl -s -o $YEAR.json --cookie "session=$SESSION" https://adventofcode.com/$YEAR/leaderboard/private/view/$USERID.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.7.0 | |
with: | |
auth: ${{ secrets.GIST_SECRET }} | |
gistID: 2cc2a13636cb044176c0fa1e7bcf7ec2 | |
filename: aoc_stars.json | |
label: 'Stars' | |
message: ${{ env.STARS }} | |
color: yellow |