This commit is contained in:
Moritz Utcke
2025-04-28 16:59:34 -03:00
parent 272b044157
commit 75723d666e

View File

@@ -33,21 +33,15 @@ jobs:
exit 1
fi
- name: Checkout auto-merge/staging-to-main
if: steps.check.outcome == 'success'
id: cpr
- name: Checkout staging and create branch
id: create_branch
run: |
# Checkout staging branch
git checkout staging
# Create a new branch for the PR
git checkout -b auto-merge/staging-to-main
# Push the new branch to the remote
git push origin auto-merge/staging-to-main
# Create the pull request using the GitHub Action
- name: Create PR from staging → main
id: create_pr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
@@ -59,15 +53,16 @@ jobs:
This PR was created automatically by GitHub Actions.
It merges the latest `staging` into `main`.
draft: false
- name: Enable auto-merge on PR
if: steps.cpr.outputs.pull-request-number != ''
if: steps.create_pr.outputs.pull-request-number != ''
uses: peter-evans/enable-pull-request-automerge@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
token: ${{ secrets.GITHUB_TOKEN }}
pull-request-number: ${{ steps.create_pr.outputs.pull-request-number }}
merge-method: merge
notify_failure:
needs: merge
if: failure()