Skip to content

Merge branch 'main' into puzzle/2015-day-1 #1

Merge branch 'main' into puzzle/2015-day-1

Merge branch 'main' into puzzle/2015-day-1 #1

Workflow file for this run

name: Auto open pull request on puzzle branches
on:
push:
branches:
- 'puzzle/**'
jobs:
open-pull-request:
runs-on: ubuntu-latest
steps:
- 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
year=${BASH_REMATCH[1]}
day=${BASH_REMATCH[2]}
issue_number=$(gh issue list -S '[$year] [Day $day] in:title' --json number | jq '.[].number')
if [ -z "$issue_number" ]; then
echo "::error::Issue not found!"
exit 1
else
echo "issue_number=${issue_number}" >> $GITHUB_OUTPUT
fi
else
echo "::error::Branch does not match the expected pattern"
exit 1
fi
env:
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
- name: create pull request
run: gh pr create -B ${{ GITHUB_DEFAULT_BRANCH }} -H ${{ github.ref_name }} --title 'Pull request to resolve #${{ steps.get_issue_number.outputs.issue_number }}'

Check failure on line 34 in .github/workflows/auto-pr.yml

View workflow run for this annotation

GitHub Actions / Auto open pull request on puzzle branches

Invalid workflow file

The workflow is not valid. .github/workflows/auto-pr.yml (Line: 34, Col: 14): Unrecognized named-value: 'GITHUB_DEFAULT_BRANCH'. Located at position 1 within expression: GITHUB_DEFAULT_BRANCH
env:
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}