Skip to content

Improve release build error handling and auto-merge the release PR#230

Merged
eason9487 merged 4 commits into
trunkfrom
fix/release-build-error-handling
Jun 11, 2026
Merged

Improve release build error handling and auto-merge the release PR#230
eason9487 merged 4 commits into
trunkfrom
fix/release-build-error-handling

Conversation

@eason9487

Copy link
Copy Markdown
Member

Changes proposed in this Pull Request:

This PR is a preparatory step for the upcoming Node.js v24 upgrade.

  • Add set -euo pipefail to github-actions-create-and-commit-build.sh and build-php-actions.sh so a failed build command stops the script immediately instead of being silently ignored.
  • Add an EXIT trap that deletes the temporary remote branch (tmp-gha-release-build) if the script fails between pushing and deleting it, so a failed run does not leave the branch behind.
  • Add a MergeReleasePR job to github-actions-release.yml that merges the release PR automatically after the version tags are updated, removing the previous manual merge step. The job targets the branch from github.event.workflow_run.head_branch and runs only on workflow_run events.
  • Update packages/github-actions/README.md and the release PR body text to describe the automated merge.

Add `set -euo pipefail` to ensure unset variables and pipeline
failures are also caught.

Without `set -e`, individual command failures in the build scripts
do not cause the script to exit. Since the scripts run via their own
shebang, they do not inherit the `set -eo pipefail` default from
GitHub Actions `run:` blocks. This could result in a broken release
build being committed and pushed silently.
If the script fails between pushing to `tmp-gha-release-build` and
deleting it, the temp branch would remain on the remote, potentially
causing naming conflicts on a subsequent release attempt.
When triggered by the normal release flow (workflow_run), automatically
merge the release/actions PR and delete the branch after the release
build and version tags are updated successfully. This replaces the
manual "Merge release PR" step. Skipped when triggered directly by a
release event (e.g. manual or pre-release).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens the GitHub Actions release automation by making release-build scripts fail fast and adding an automated step to merge the release PR after tags are updated (as preparation for the upcoming Node.js v24 upgrade).

Changes:

  • Enable set -euo pipefail in release build scripts to stop immediately on errors.
  • Add an EXIT trap to clean up the temporary remote build branch if failures occur mid-run.
  • Add a MergeReleasePR job to auto-merge the release PR after tag updates, and update docs/PR body text accordingly.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/github-actions/README.md Updates release process docs to reflect automated PR merge.
packages/github-actions/build-php-actions.sh Enables fail-fast bash settings for PHP action build script.
.github/workflows/github-actions-release.yml Adds a job that merges the release PR automatically after updating tags.
.github/scripts/github-actions-create-and-commit-build.sh Enables fail-fast bash settings and adds temp-branch cleanup logic via EXIT trap.
.github/scripts/create-pr-for-release.mjs Updates generated release PR body to describe the automated merge.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/github-actions-release.yml
Comment thread .github/scripts/github-actions-create-and-commit-build.sh Outdated
Under `set -euo pipefail`, a failed `git push -d` for the temporary
branch would fail an otherwise successful release. Guard the delete with
an `if` so a cleanup failure does not abort the run, and let the EXIT
trap retry it.
@eason9487 eason9487 merged commit d22adee into trunk Jun 11, 2026
19 checks passed
@eason9487 eason9487 deleted the fix/release-build-error-handling branch June 11, 2026 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants