Skip to content

Commit 751fde7

Browse files
authored
ci: update readme-stars workflow (#36)
* update checkout action to v4 * update git-auto-commit-action to v5, add required write permission * use variable for run condition, check on job level
1 parent 656bd38 commit 751fde7

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

.github/workflows/readme-stars.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,16 @@ on:
99
jobs:
1010
update-readme:
1111
runs-on: ubuntu-latest
12+
if: ${{ vars.AOC_ENABLED == 'true' }}
13+
permissions:
14+
contents: write
1215
steps:
13-
- uses: actions/checkout@v3
14-
if: ${{ env.AOC_ENABLED }}
15-
env:
16-
AOC_ENABLED: ${{ secrets.AOC_ENABLED }}
16+
- uses: actions/checkout@v4
1717
- uses: k2bd/advent-readme-stars@v1
18-
if: ${{ env.AOC_ENABLED }}
19-
env:
20-
AOC_ENABLED: ${{ secrets.AOC_ENABLED }}
2118
with:
2219
userId: ${{ secrets.AOC_USER_ID }}
2320
sessionCookie: ${{ secrets.AOC_SESSION }}
2421
year: ${{ secrets.AOC_YEAR }}
25-
- uses: stefanzweifel/git-auto-commit-action@v4
26-
if: ${{ env.AOC_ENABLED }}
27-
env:
28-
AOC_ENABLED: ${{ secrets.AOC_ENABLED }}
22+
- uses: stefanzweifel/git-auto-commit-action@v5
2923
with:
3024
commit_message: "update readme progess"

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ cargo read <day>
161161
### Configure aoc-cli integration
162162

163163
1. Install [`aoc-cli`](https://github.com/scarvalhojr/aoc-cli/) via cargo: `cargo install aoc-cli --version 0.12.0`
164-
2. Create an `.adventofcode.session` file in your home directory and paste your session cookie. To retrieve the session cookie, press F12 anywhere on the Advent of Code website to open your browser developer tools. Look in _Cookies_ under the _Application_ or _Storage_ tab, and copy out the `session` cookie value. [^1]
164+
2. Create an `.adventofcode.session` file in your home directory and paste your session cookie. To retrieve the session cookie, press F12 anywhere on the Advent of Code website to open your browser developer tools. Look in _Cookies_ under the _Application_ or _Storage_ tab, and copy out the `session` cookie value. [^1]
165165

166166
Once installed, you can use the [download command](#download-input--description-for-a-day) and automatically submit solutions via the [`--submit` flag](#submitting-solutions).
167167

@@ -179,11 +179,14 @@ Go to the leaderboard page of the year you want to track and click _Private Lead
179179

180180
Go to the _Secrets_ tab in your repository settings and create the following secrets:
181181

182-
- `AOC_ENABLED`: This variable controls whether the workflow is enabled. Set it to `true` to enable the progress tracker.
183182
- `AOC_USER_ID`: Go to [this page](https://adventofcode.com/settings) and copy your user id. It's the number behind the `#` symbol in the first name option. Example: `3031`.
184183
- `AOC_YEAR`: the year you want to track. Example: `2021`.
185184
- `AOC_SESSION`: an active session[^2] for the advent of code website. To get this, press F12 anywhere on the Advent of Code website to open your browser developer tools. Look in your Cookies under the Application or Storage tab, and copy out the `session` cookie.
186185

186+
Go to the _Variables_ tab in your repository settings and create the following variable:
187+
188+
- `AOC_ENABLED`: This variable controls whether the workflow is enabled. Set it to `true` to enable the progress tracker.
189+
187190
✨ You can now run this action manually via the _Run workflow_ button on the workflow page. If you want the workflow to run automatically, uncomment the `schedule` section in the `readme-stars.yml` workflow file or add a `push` trigger.
188191

189192
### Check code formatting / clippy lints in CI

0 commit comments

Comments
 (0)