-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (39 loc) · 1.3 KB
/
update-issue.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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.issue.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.issue.number }}
body: |
### Challenge link
https://adventofcode.com/${{ steps.issue-parser.outputs.issueparser_challenge-year }}/day/${{ steps.extract.outputs.day }}