This commit is contained in:
Moritz Utcke
2025-04-28 16:48:34 -03:00
parent 35c24b0380
commit 10bc17963a

View File

@@ -29,24 +29,35 @@ jobs:
run: | run: |
git fetch origin git fetch origin
if [ $(git rev-list --count origin/staging..origin/main) -gt 0 ]; then if [ $(git rev-list --count origin/staging..origin/main) -gt 0 ]; then
echo "❌ Staging ist hinter Main und benötigt ein Merge." echo "❌ Staging is behind main and requires manual merging."
exit 1 exit 1
fi fi
- name: Create or update PR from staging → main - name: Create or update PR from staging → main
if: steps.check.outcome == 'success' if: steps.check.outcome == 'success'
id: cpr id: cpr
uses: peter-evans/create-pull-request@v4 run: |
with: # Checkout staging branch
token: ${{ secrets.GITHUB_TOKEN }} git checkout staging
commit-message: "chore: auto-merge staging into main"
branch: auto-merge/staging-to-main # Create a new branch for the PR
base: main git checkout -b auto-merge/staging-to-main
title: "Auto-merge staging into main"
body: | # Push the new branch to the remote
This PR was created automatically by GitHub Actions. git push origin auto-merge/staging-to-main
It merges the latest `staging` into `main`.
draft: false # Create the pull request using the GitHub Action
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: auto-merge staging into main"
branch: auto-merge/staging-to-main
base: main
title: "Auto-merge staging into main"
body: |
This PR was created automatically by GitHub Actions.
It merges the latest `staging` into `main`.
draft: false
- name: Enable auto-merge on PR - name: Enable auto-merge on PR
if: steps.cpr.outputs.pull-request-number != '' if: steps.cpr.outputs.pull-request-number != ''