Skip to content

[2023] Day 5

[2023] Day 5 #145

Workflow file for this run

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
- name: Update readme
run: |
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/2022/stats) coders
### Progress
EOF
{ printf "|Day" ;
for folder in $("ls" -d */)
do
printf "|[${folder%/}](https://adventofcode.com/${folder%/})"
done
echo "|"
} >> $out
{ printf "|--:" ;
for folder in $("ls" -d */)
do
printf "| :---: "
done
echo "|"
} >> $out
for i in $(seq -w 25)
do
printf "$i"
for folder in $("ls" -d */)
do
printf "|"
compgen -G "$folder$i/first*" >/dev/null && printf ":star:"
compgen -G "$folder$i/second*" > /dev/null && printf ":star:"
done
printf "\n"
done >> $out
- name: Commit change
uses: EndBug/add-and-commit@v9
with:
author_name: agagniere
author_email: angagnie@student.42.fr
message: "(update readme)"
add: README.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}