update work flow to actually fail (#7069)

* the workflow has been failing silently without catching a merge
  conflict. this removes the fail pretty logic previously implemented.
* just fail if a merge conflict is encountered
This commit is contained in:
Jake Jackson
2025-08-21 14:49:54 -04:00
committed by GitHub
parent 4e332ac2c7
commit 36ec5efc88

View File

@@ -12,41 +12,24 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: write contents: write
strategy:
matrix:
target_branch:
- release_4.6-next
- stable-2.6
steps: steps:
- name: Checkout ${{ matrix.target_branch }} Branch - name: Checkout stable-2.6 branch
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
ref: ${{ matrix.target_branch }} ref: stable-2.6
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch release_4.6 Branch for ${{ matrix.target_branch }} - name: Fetch release_4.6 branch for rebase
run: git fetch origin release_4.6:release_4.6 run: git fetch origin release_4.6:release_4.6
- name: Attempt Rebase release_4.6 into ${{ matrix.target_branch }} - name: Attempt Rebase release_4.6 into stable-2.6
id: rebase_attempt id: rebase_attempt
run: | run: |
git config user.name "GitHub Actions" git config user.name "GitHub Actions"
git config user.email "github-actions[bot]@users.noreply.github.com" git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout ${{ matrix.target_branch }} git checkout stable-2.6
git rebase release_4.6 || true git rebase release_4.6
continue-on-error: true # Allow this step to fail without stopping the workflow immediately
- name: Check for Conflicts and Abort if Necessary for ${{ matrix.target_branch }} - name: Force Push Rebased stable-2.6 Branch
run: | run: |
if git status --porcelain | grep "^UU"; then git push --force origin stable-2.6
echo "::error::Rebase failed for ${{ matrix.target_branch }} due to merge conflicts. Aborting rebase."
git rebase --abort
exit 1 # Fail the job explicitly
else
echo "Rebase for ${{ matrix.target_branch }} completed without conflicts."
fi
- name: Force Push Rebased ${{ matrix.target_branch }} Branch
if: success() && steps.rebase_attempt.outcome != 'failure'
run: |
git push --force origin ${{ matrix.target_branch }}