Skip to content

Update AoC Badges πŸŽ„ #101

Update AoC Badges πŸŽ„

Update AoC Badges πŸŽ„ #101

Workflow file for this run

name: Update AoC Badges πŸŽ„
on:
schedule:
- cron: '0 6 1-31 12 *'
workflow_dispatch:
push:
paths:
- '**/**/main.py'
- '**/**.rs'
jobs:
Update:
name: Update AoC Badges πŸŽ„
runs-on: ubuntu-latest
steps:
- name: Get current year
id: currentYear
run: echo "::set-output name=year::$(date +'%Y')"
- uses: actions/checkout@v2
- name: Update badges
uses: joblo2213/aoc-badges-action@v2.1
with:
userid: 497788
session: ${{ secrets.AOC_SESSION }}
leaderboard: 'https://adventofcode.com/${{ steps.currentYear.outputs.year }}/leaderboard/private/view/670567.json'
file: 'README.md'
# dayRegex: '(?<=https:\/\/img\.shields\.io\/badge\/day%20πŸ“…-)[0-9]+(?=-blue)'
starsRegex: '(?<=https:\/\/img\.shields\.io\/badge\/Stars%20)[0-9]+(?=-yellow)'
daysCompletedRegex: '(?<=https:\/\/img\.shields\.io\/badge\/Survived%20Days-)[0-9]+(?=-red)'
- name: Commit changes
run: |
git config --global user.email "git@daanbreur.systems"
git config --global user.name "Badge Updater"
git add .
git diff-index --quiet HEAD || git commit --message "[${{ steps.currentYear.outputs.year }}] Update badges"
git push