[2024] [Day 22]: Monkey Market #231
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: Update issue | |
on: | |
issues: | |
types: | |
- opened | |
- reopened | |
jobs: | |
update-issue: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Parsing issue | |
id: issue-parser | |
uses: stefanbuck/github-issue-parser@v3 | |
with: | |
template-path: .github/ISSUE_TEMPLATE/challenge.yml | |
- name: Adding milestone to issue | |
uses: Julexar/[email protected] | |
with: | |
token: "${{ secrets.ACTION_TOKEN }}" | |
milestone: "${{ steps.issue-parser.outputs.issueparser_challenge-year }} Challenges" | |
- name: Run bash script to extract day from issue title | |
id: extract | |
run: | | |
string="${{ github.event.issue.title }}" | |
if [[ $string =~ Day\ ([0-9]+) ]]; then | |
day=${BASH_REMATCH[1]} | |
echo "day=${day}" >> $GITHUB_OUTPUT | |
else | |
echo "::error::Title does not match the expected pattern" | |
fi | |
- name: Create comment | |
uses: peter-evans/create-or-update-comment@v4 | |
with: | |
token: "${{ secrets.ACTION_TOKEN }}" | |
issue-number: ${{ github.event.issue.number }} | |
body: | | |
### Challenge link | |
https://adventofcode.com/${{ steps.issue-parser.outputs.issueparser_challenge-year }}/day/${{ steps.extract.outputs.day }} |