Add auto dev → release PR workflow (#5) #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: Auto release PR | |
| on: | |
| push: | |
| branches: [dev] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| open-release-pr: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check for existing PR | |
| id: check | |
| run: | | |
| pr=$(gh pr list --base release --head dev --state open --json number --jq '.[0].number') | |
| echo "existing_pr=$pr" >> "$GITHUB_OUTPUT" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create PR if none exists | |
| if: steps.check.outputs.existing_pr == '' | |
| run: | | |
| gh pr create \ | |
| --base release \ | |
| --head dev \ | |
| --title "Release: merge dev into release" \ | |
| --body "Automated PR to merge dev changes into release." | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |