Merge pull request #842 from Disane87/ci/skip-conv-commit-on-bot-prs #33
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 PR to Main" | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| jobs: | |
| create-pr: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check if PR already exists | |
| id: check-pr | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| PR_NUMBER=$(gh pr list --base main --head dev --state open --json number --jq '.[0].number') | |
| if [ -n "$PR_NUMBER" ]; then | |
| echo "exists=true" >> $GITHUB_OUTPUT | |
| echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT | |
| else | |
| echo "exists=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Update existing PR | |
| if: steps.check-pr.outputs.exists == 'true' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh pr edit ${{ steps.check-pr.outputs.pr_number }} --body "$(cat <<'EOF' | |
| ## π¦ Automated Release PR | |
| This PR merges the latest changes from \`dev\` into \`main\`. | |
| **Last updated:** $(date -u '+%Y-%m-%d %H:%M:%S UTC') | |
| ### π What's Changed | |
| Review the commits below to see what will be included in this release. | |
| ### β Checklist before merging | |
| - [ ] All tests pass | |
| - [ ] CHANGELOG.md is updated | |
| - [ ] Version number is bumped if needed | |
| - [ ] All features are documented | |
| - [ ] No breaking changes (or documented in release notes) | |
| ### π¦ Merge Instructions | |
| 1. Review all changes carefully | |
| 2. Ensure CI/CD passes | |
| 3. Update the title with the actual version if releasing | |
| 4. Convert from draft to ready when prepared | |
| 5. Merge using **merge commit** (not squash) | |
| --- | |
| *This PR was automatically updated by the Auto PR workflow* | |
| EOF | |
| )" | |
| - name: Create new PR | |
| if: steps.check-pr.outputs.exists == 'false' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh pr create --base main --head dev --draft \ | |
| --title "π Release: Merge dev into main" \ | |
| --body "$(cat <<'EOF' | |
| ## π¦ Automated Release PR | |
| This PR merges the latest changes from \`dev\` into \`main\`. | |
| **Created:** $(date -u '+%Y-%m-%d %H:%M:%S UTC') | |
| ### π What's Changed | |
| Review the commits below to see what will be included in this release. | |
| ### β Checklist before merging | |
| - [ ] All tests pass | |
| - [ ] CHANGELOG.md is updated | |
| - [ ] Version number is bumped if needed | |
| - [ ] All features are documented | |
| - [ ] No breaking changes (or documented in release notes) | |
| ### π¦ Merge Instructions | |
| 1. Review all changes carefully | |
| 2. Ensure CI/CD passes | |
| 3. Update the title with the actual version if releasing | |
| 4. Convert from draft to ready when prepared | |
| 5. Merge using **merge commit** (not squash) | |
| --- | |
| *This PR was automatically created by the Auto PR workflow* | |
| EOF | |
| )" |