2024 day 4 #187
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: CI | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
Readme: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: Update readme | |
run: | | |
# Without this line, the values set inside the loop wouldnt persist | |
out="README.md" | |
cat <<-'EOF' > $out | |
# Advent of Code | |
My solutions for the [Advent of Code](https://adventofcode.com), a challenge started by [200,000+](https://adventofcode.com/2023/stats) coders | |
### Progress | |
EOF | |
bash generate_report.sh >> $out | |
- name: Commit change | |
uses: EndBug/add-and-commit@v9 | |
with: | |
author_name: agagniere | |
author_email: [email protected] | |
message: "(update readme)" | |
add: README.md | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |