This guide will help you quickly configure a new repository from this template for the current year's Advent of Code.
❗ IMPORTANT: Template Maintenance
Before starting the setup: Ensure the Maintenance Tasks section is completed on the template repository to guarantee that all dependencies are up-to-date.
- Open the main page of the template repository.
- Click Use this template and then Create a new repository.
- Name the new repository (e.g.,
advent-of-code-202X).
You need to set up two tokens: a GitHub Personal Access Token (PAT_TOKEN) and the Codacy token (CODACY_PROJECT_TOKEN).
Both tokens must be added to Actions and Dependabot secrets in order to GitHub Actions and Dependabot to function correctly.
The PAT_TOKEN is required for GitHub Actions and Dependabot to function properly:
- Verify/Create the PAT:
- Go to Personal access tokens (classic).
- If you don't have a token named
PAT_TOKEN(or similar), click Generate New Token, select thereposcope, and copy the generated token. - If an existing
PAT_TOKENis close to expiring, click on it, select regenerate the token, and copy the new value.
- Go to Settings / Secrets and variables.
- Add the Secret under the name
PAT_TOKENboth at Actions and Dependabot secrets.
The CODACY_PROJECT_TOKEN is required to send code coverage reports to Codacy:
- Get the Codacy Token:
- Go to Codacy and add your new repository.
- Open Settings / Coverage and copy the
CODACY_PROJECT_TOKENvalue.
- Go to Settings / Secrets and variables.
- Add the Secret under the name
CODACY_PROJECT_TOKENboth at Actions and Dependabot secrets.
- Run "Update year" Workflow:
- Go to the Actions tab and open the Update year workflow.
- Click Run workflow, type the year in
yyyyformat (e.g.,2025), and Run workflow.
- Merge the Pull Request:
- The workflow will automatically create a Pull Request.
- Open it, verify the year changes are correct, and merge it.
After merging, the repository description, topics, and all
README.mdandpom.xmlfiles will be updated with the correct year.
To privately manage your input files for each day.
- Create Data Repository:
- Create a private repository using the advent-of-code-yyyy-data template.
- Add as a Submodule:
git clone https://github.com/Flashky/advent-of-code-{year}.git &&
cd advent-of-code-{year} &&
git submodule add -b master https://github.com/Flashky/advent-of-code-{year}-data.git src/test/resources/inputs &&
git commit -m "test: add data repository as submodule" &&
git push- Go to Codacy and open your repository.
- Open Settings / General and copy both the
code qualityandcoveragebadges. - Add them to this
README.md(replace or add to the top).
- Remove all these setup instructions from the
README.md. - Commit and push the changes.
Enjoy your new Advent of Code edition!
⚠️ These steps should be performed on the original template repository before creating the new repository.
- Go to the dependency graph.
- Manually run the following jobs:
pom.xmland.github/workflows/build-report.yml. - Review and merge any pending pull requests.
- Day 1
- Day 2
- Day 3
- Day 4
- Day 5
- Day 6
- Day 7
- Day 8
- Day 9
- Day 10
- Day 11
- Day 12
- Day 13
- Day 14
- Day 15
- Day 16
- Day 17
- Day 18
- Day 19
- Day 20
- Day 21
- Day 22
- Day 23
- Day 24
- Day 25
Without data repository:
git clone https://github.com/Flashky/advent-of-code-{year}.gitIncluding data repository:
git clone https://github.com/Flashky/advent-of-code-{year}.git --recurse-submodules