Skip to content

Update year

Update year #12

Workflow file for this run

name: Update year
on:
workflow_dispatch:
inputs:
aoc_year:
description: 'Advent of Code year'
required: true
default: 'yyyy'
jobs:
update-year:
runs-on: ubuntu-latest
steps:
- name: Check Year Format
run: |
if echo "${{ github.event.inputs.aoc_year }}" | grep -E -q '^[0-9]{4}$'; then
echo "Year '${{ github.event.inputs.aoc_year }}' format is valid."
else
echo "Error: Invalid year format. Please provide a valid 4-digit year."
exit 1
fi
- uses: actions/checkout@v3
- name: Update README.md
run: |
find . -name 'README.md' | xargs sed -i 's/{year}/'${{ github.event.inputs.aoc_year }}'/g'
- name: Update pom.xml
run: |
find . -name 'pom.xml' | xargs sed -i 's/yyyy/'${{ github.event.inputs.aoc_year }}'/g'
- name: Check changes
run: |
cat "src/main/java/com/adventofcode/flashk/day01/README.md"
cat "pom.xml"