From 1126b4add895cb0f9ad33ce60f8f41dbb178d233 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Thu, 16 Oct 2025 21:18:53 -0500 Subject: [PATCH 1/2] change to reset for rollback strategy for clean rollback --- .github/workflows/release.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 20e656c..5b22828 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -929,7 +929,7 @@ jobs: pkg_dist_rhel/** rollback-on-build-failure: - needs: [wait-for-main-pr, build-windows, build-debian, build-arch, build-rhel] + needs: [merge-develop-to-main, wait-for-main-pr, build-windows, build-debian, build-arch, build-rhel] if: | ${{ always() && @@ -971,21 +971,21 @@ jobs: # Fetch latest git fetch origin main - # Get the merge commit that needs to be reverted - MERGE_COMMIT="${{ needs.wait-for-main-pr.outputs.merge_commit_sha }}" - echo "Reverting merge commit: $MERGE_COMMIT" + # Get the previous main SHA (before the merge) + PREVIOUS_MAIN_SHA="${{ needs.merge-develop-to-main.outputs.previous_main_sha }}" + echo "Resetting main to previous commit: $PREVIOUS_MAIN_SHA" - # Checkout main and create revert commit + # Checkout main and reset to previous commit git checkout main - git revert "$MERGE_COMMIT" --no-edit -m 1 + git reset --hard "$PREVIOUS_MAIN_SHA" - # Push the revert commit with error handling - if ! git push origin main; then - echo "::error::Failed to push revert commit" + # Force push the rollback + if ! git push --force origin main; then + echo "::error::Failed to push rollback to main" exit 1 fi - echo "::error::Reverted merge commit $MERGE_COMMIT on main branch" + echo "::error::Reset main branch to commit $PREVIOUS_MAIN_SHA" echo "::error::Build failures detected:" # Report which builds failed -- 2.47.3 From 42265a32409ea4f05083eede90ab153b32b60d54 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Thu, 16 Oct 2025 21:23:24 -0500 Subject: [PATCH 2/2] add git notes automation for record keeping of rollbacks --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5b22828..f98a21d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -981,10 +981,11 @@ jobs: # Force push the rollback if ! git push --force origin main; then + git notes -m 'release commit could not be rolled back' echo "::error::Failed to push rollback to main" exit 1 fi - + git notes -m 'release commit rolled back' echo "::error::Reset main branch to commit $PREVIOUS_MAIN_SHA" echo "::error::Build failures detected:" -- 2.47.3