Skip to content

Create workflow to submit solution #5

Open
@brendanator

Description

@brendanator
  • Create GitHub workflow called submit-advent-of-code.yml
  • Trigger on
    • Push to main with file changes to puzzles/year_*/day_*/answer_part*.txt
    • workflow_dispatch
  • Set env vars
    • AOC_SESSION: secrets.AOC_SESSION
    • GH_TOKEN: secrets.USER_TOKEN
  • Set up
    • Check out repo - uses: actions/checkout@v4
    • Setup uv - uses astral-sh/setup-uv@v4 and uv sync
  • Set concurrency to only run one at a time in this repo and don't cancel in progress runs
  • Add permissions needed: content, issues
  • Submit solution using uv run advent_of_code.py submit {year} {day} {part}
    • Mark this step as successful even if the exit code was 1
  • Update results section in README.md by running uv run advent_of_code.py update-results {year}
  • If it was part 1 and the submission was correct:
    • download part two with uv run advent_of_code.py download {year} {day} and output the part which is printed by the command
  • Commit and push puzzles in puzzles with user GitHub Actions
  • Trigger create-puzzle-issue.yml using the year, day and part 2 as strings if part two was downloaded
    • uses: sourcery-ai/autonomous-advent-of-code/.github/workflows/create-puzzle-issue.yml@main

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions