File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 99 open-pull-request :
1010 runs-on : ubuntu-latest
1111 steps :
12- - name : checkout
12+ - name : Checkout
1313 uses : actions/checkout@v4
1414
15- - name : get issue number
15+ - name : Get issue number
1616 id : get_issue_number
1717 run : |
1818 if [[ ${{ github.ref_name }} =~ puzzle/([0-9]{4})-day-([1-9]|1[0-9]|2[0-5]) ]]; then
3333 fi
3434 env :
3535 GITHUB_TOKEN : ${{ secrets.ACTION_TOKEN }}
36- - name : create pull request
36+ - name : Create pull request
3737 run : |
3838 gh pr create -B main -H ${{ github.ref_name }} -t "Pull request to resolve #${{ steps.get_issue_number.outputs.issue_number }}" -b ""
3939 env :
Original file line number Diff line number Diff line change 88 - opened
99
1010jobs :
11- submit -answer :
11+ get -answer :
1212 runs-on : ubuntu-latest
1313 steps :
1414 - name : Checkout
2222 - name : Extract year and day from branch name
2323 id : extract
2424 run : |
25- branch_name=$(echo ${{ github.event.pull_request.head.ref }})
25+ branch_name=$(echo " ${{ github.event.pull_request.head.ref }}" )
2626
2727 if [[ $branch_name =~ puzzle/([0-9]{4})-day-([1-9]|1[0-9]|2[0-5]) ]]; then
2828 year="${BASH_REMATCH[1]}"
3333 else
3434 echo "Branch name does not follow the expected pattern."
3535 exit 1
36+ fi
3637
3738 - name : Get answer
3839 id : get_answer
5051 else
5152 echo "Script not found: $script_path"
5253 exit 1
54+ fi
5355
5456 - name : Submit answer
5557 id : submit_answer
Original file line number Diff line number Diff line change @@ -12,27 +12,32 @@ jobs:
1212 steps :
1313 - name : Checkout
1414 uses : actions/checkout@v4
15+
1516 - name : Parsing issue
1617 id : issue-parser
1718 uses : stefanbuck/github-issue-parser@v3
1819 with :
1920 template-path : .github/ISSUE_TEMPLATE/puzzle.yml
21+
2022 - name : Adding milestone to issue
21232224 with :
2325 token : " ${{ secrets.ACTION_TOKEN }}"
2426 milestone : " ${{ steps.issue-parser.outputs.issueparser_puzzle-year }} Puzzles"
27+
2528 - name : Run bash script to extract day from issue title
2629 id : extract
2730 run : |
2831 title="${{ github.event.issue.title }}"
32+
2933 if [[ $title =~ Day\ ([0-9]+) ]]; then
3034 day=${BASH_REMATCH[1]}
3135 echo "day=${day}" >> $GITHUB_OUTPUT
3236 else
3337 echo "::error::Title does not match the expected pattern"
3438 exit 1
3539 fi
40+
3641 - name : Create comment
3742 uses : peter-evans/create-or-update-comment@v4
3843 with :
You can’t perform that action at this time.
0 commit comments