-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update and rename add-milestone-to-issue.yml to update-issue.yml
- Loading branch information
1 parent
ae48097
commit 52f4201
Showing
2 changed files
with
41 additions
and
24 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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 }} |