Update AoC Badges π #78
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
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 |