Skip to content

Commit

Permalink
Update and rename add-milestone-to-issue.yml to update-issue.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
victoraugustofd authored Dec 22, 2024
1 parent ae48097 commit 52f4201
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 24 deletions.
24 changes: 0 additions & 24 deletions .github/workflows/add-milestone-to-issue.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/update-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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.title }}"
if [[ $string =~ Day\ ([0-9]+) ]]; then
day=${BASH_REMATCH[1]}
echo "::set-output name=day::$day"
else
echo "::error::Title does not match the expected pattern"
fi
- name: Create comment
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.number }}
body: |
### Challenge link
https://adventofcode.com/${{ steps.issue-parser.outputs.issueparser_challenge-year }}/day/${{ steps.extract.outputs.day }}

0 comments on commit 52f4201

Please sign in to comment.