Skip to content

Merge pull request #869 from Disane87/renovate/ruff-0.x #51

Merge pull request #869 from Disane87/renovate/ruff-0.x

Merge pull request #869 from Disane87/renovate/ruff-0.x #51

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@v7
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
)"