Skip to content

Commit

Permalink
fix: fixing syntax error
Browse files Browse the repository at this point in the history
  • Loading branch information
victoraugustofd committed Jan 5, 2025
1 parent 032b519 commit c911905
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/auto-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
open-pull-request:
runs-on: ubuntu-latest
steps:
- name: checkout
- name: Checkout
uses: actions/checkout@v4

- name: get issue number
- name: Get issue number
id: get_issue_number
run: |
if [[ ${{ github.ref_name }} =~ puzzle/([0-9]{4})-day-([1-9]|1[0-9]|2[0-5]) ]]; then
Expand All @@ -33,7 +33,7 @@ jobs:
fi
env:
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
- name: create pull request
- name: Create pull request
run: |
gh pr create -B main -H ${{ github.ref_name }} -t "Pull request to resolve #${{ steps.get_issue_number.outputs.issue_number }}" -b ""
env:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/check-resolution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- opened

jobs:
submit-answer:
get-answer:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -22,7 +22,7 @@ jobs:
- name: Extract year and day from branch name
id: extract
run: |
branch_name=$(echo ${{ github.event.pull_request.head.ref }})
branch_name=$(echo "${{ github.event.pull_request.head.ref }}")
if [[ $branch_name =~ puzzle/([0-9]{4})-day-([1-9]|1[0-9]|2[0-5]) ]]; then
year="${BASH_REMATCH[1]}"
Expand All @@ -33,6 +33,7 @@ jobs:
else
echo "Branch name does not follow the expected pattern."
exit 1
fi
- name: Get answer
id: get_answer
Expand All @@ -50,6 +51,7 @@ jobs:
else
echo "Script not found: $script_path"
exit 1
fi
- name: Submit answer
id: submit_answer
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/update-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,32 @@ jobs:
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/puzzle.yml

- name: Adding milestone to issue
uses: Julexar/[email protected]
with:
token: "${{ secrets.ACTION_TOKEN }}"
milestone: "${{ steps.issue-parser.outputs.issueparser_puzzle-year }} Puzzles"

- name: Run bash script to extract day from issue title
id: extract
run: |
title="${{ github.event.issue.title }}"
if [[ $title =~ Day\ ([0-9]+) ]]; then
day=${BASH_REMATCH[1]}
echo "day=${day}" >> $GITHUB_OUTPUT
else
echo "::error::Title does not match the expected pattern"
exit 1
fi
- name: Create comment
uses: peter-evans/create-or-update-comment@v4
with:
Expand Down

0 comments on commit c911905

Please sign in to comment.