Skip to content

Commit 0341ac5

Browse files
Merge pull request #176 from amclin/feat/status-badges
feat(docs): show current progress status, autoupdated
2 parents db61e1f + 84c071e commit 0341ac5

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

.github/workflows/update-badges.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Update AoC Badges
2+
on:
3+
schedule: # run workflow based on schedule
4+
- cron: '0 6 1-25 12 *' # from the 1. December till 25. December every day at 6am
5+
6+
workflow_dispatch: # allow to manually start the workflow
7+
8+
# push: # (disabled) run on push, be carefull with this setting
9+
# as the workflow should only be triggered at a rate lower than
10+
# 4 times a houre to keep traffic on aoc site low
11+
jobs:
12+
update:
13+
runs-on: ubuntu-latest
14+
steps:
15+
16+
- uses: actions/checkout@v2 # clones your repo, make sure the ssh secret is set!
17+
with:
18+
ssh-key: ${{ secrets.SSH_KEY }}
19+
20+
- uses: joblo2213/[email protected]
21+
with:
22+
userid: ${{ secrets.AOC_BOARD_ID }} # your user id, see setup on how to obtain
23+
session: ${{ secrets.AOC_SESSION }} # secret containing session code, see setup on how to obtain
24+
25+
# Optional inputs:
26+
#
27+
# leaderboard: 'https://adventofcode.com/2020/leaderboard/private/view/00000.json' # The url of the leaderboard from witch the data is fetched. Typically your private leaderboard.
28+
# file: 'README.md' # The file that contains the badges
29+
# dayRegex: '(?<=https:\/\/img\.shields\.io\/badge\/day%20📅-)[0-9]+(?=-blue)' # Regular expression that finds the content of the day badge iun your file.
30+
# starsRegex: '(?<=https:\/\/img\.shields\.io\/badge\/stars%20⭐-)[0-9]+(?=-yellow)' # Regular expression that finds the content of the stars badge iun your file.
31+
# daysCompletedRegex: '(?<=https:\/\/img\.shields\.io\/badge\/days%20completed-)[0-9]+(?=-red)' # Regular expression that finds the content of the days completed badge iun your file.
32+
33+
- uses: stefanzweifel/git-auto-commit-action@v4
34+
name: Push changes # Step that pushes these local changes back to your github repo
35+
commit_message: "docs: Update badges [skip ci]"
36+
file_pattern: README.md

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
[![Build Status](https://github.com/amclin/advent-of-code/actions/workflows/release.yml/badge.svg)](https://github.com/amclin/advent-of-code/actions/workflows/release.yml)
33
[![codecov](https://codecov.io/gh/amclin/advent-of-code/branch/master/graph/badge.svg)](https://codecov.io/gh/amclin/advent-of-code)
44

5+
## Status
6+
7+
### 2020
8+
![](https://img.shields.io/badge/day%20📅-6-blue)
9+
![](https://img.shields.io/badge/stars%20⭐-12-yellow)
10+
![](https://img.shields.io/badge/days%20completed-6-red)
11+
512
## Start a boilerplate for a new day
613
`npm run new`
714
### Special Instructions

0 commit comments

Comments
 (0)