use variable + move run condition to job
This commit is contained in:
parent
3e99d7b23b
commit
6334ed20fa
2 changed files with 6 additions and 11 deletions
10
.github/workflows/readme-stars.yml
vendored
10
.github/workflows/readme-stars.yml
vendored
|
@ -9,24 +9,16 @@ on:
|
|||
jobs:
|
||||
update-readme:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ vars.AOC_ENABLED == 'true' }}
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
if: ${{ env.AOC_ENABLED == 'true' }}
|
||||
env:
|
||||
AOC_ENABLED: ${{ secrets.AOC_ENABLED }}
|
||||
- uses: k2bd/advent-readme-stars@v1
|
||||
if: ${{ env.AOC_ENABLED == 'true' }}
|
||||
env:
|
||||
AOC_ENABLED: ${{ secrets.AOC_ENABLED }}
|
||||
with:
|
||||
userId: ${{ secrets.AOC_USER_ID }}
|
||||
sessionCookie: ${{ secrets.AOC_SESSION }}
|
||||
year: ${{ secrets.AOC_YEAR }}
|
||||
- uses: stefanzweifel/git-auto-commit-action@v5
|
||||
if: ${{ env.AOC_ENABLED == 'true' }}
|
||||
env:
|
||||
AOC_ENABLED: ${{ secrets.AOC_ENABLED }}
|
||||
with:
|
||||
commit_message: "update readme progess"
|
||||
|
|
|
@ -179,11 +179,14 @@ Go to the leaderboard page of the year you want to track and click _Private Lead
|
|||
|
||||
Go to the _Secrets_ tab in your repository settings and create the following secrets:
|
||||
|
||||
- `AOC_ENABLED`: This variable controls whether the workflow is enabled. Set it to `true` to enable the progress tracker.
|
||||
- `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`.
|
||||
- `AOC_YEAR`: the year you want to track. Example: `2021`.
|
||||
- `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.
|
||||
|
||||
Go to the _Variables_ tab in your repository settings and create the following variable:
|
||||
|
||||
- `AOC_ENABLED`: This variable controls whether the workflow is enabled. Set it to `true` to enable the progress tracker.
|
||||
|
||||
✨ 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.
|
||||
|
||||
### Check code formatting / clippy lints in CI
|
||||
|
|
Loading…
Add table
Reference in a new issue