perf: testing PR automation #1
This file contains hidden or 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
| name: Ensure jjones/automatingPR → dev PR exists | |
| on: | |
| push: | |
| branches: | |
| - jjones/automatingPR | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| ensure-pr: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Create PR if missing | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| PR_COUNT=$(gh pr list \ | |
| --base dev \ | |
| --head jjones/automatingPR \ | |
| --state open \ | |
| --json number \ | |
| --jq 'length') | |
| if [ "$PR_COUNT" -eq 0 ]; then | |
| gh pr create \ | |
| --base dev \ | |
| --head jjones/automatingPR \ | |
| --title "Merge jjones/automatingPR into dev" \ | |
| --body "Test PR automatically created when jjones/automatingPR is pushed to." | |
| else | |
| echo "PR already exists. It will update automatically." | |
| fi |