Repository navigation
fix(ci): prevent setup-env BASH_ENV self-source recursion - #375
Merged
c-vigo merged 1 commit intoMar 19, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a CI regression in the shared setup-env composite action where repeated invocations in the same job could cause the retry-helper BASH_ENV script to recursively source itself and crash (exit 139), and it records the fix in the 0.3.1 changelog.
Changes:
- Add a guard in
.github/actions/setup-env/action.ymlto avoid mergingBASH_ENVwhen it already points at the retry-helper script (preventing self-source recursion). - Add a 0.3.1 “Fixed” changelog entry for issue #374 in
CHANGELOG.md. - Sync the same changelog entry into
assets/workspace/.devcontainer/CHANGELOG.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/actions/setup-env/action.yml |
Prevents BASH_ENV merge logic from self-referencing the retry-helper script on repeated runs. |
CHANGELOG.md |
Documents the fix for #374 under the 0.3.1 “Fixed” section. |
assets/workspace/.devcontainer/CHANGELOG.md |
Mirrors the changelog update for the workspace/devcontainer template copy. |
Comments suppressed due to low confidence (1)
.github/actions/setup-env/action.yml:208
- When
PREV_BASH_ENV == RETRY_HELPERthe merge is skipped, but the helper file was already overwritten earlier in the step (cat > "$RETRY_HELPER"). This means any original job-providedBASH_ENVthat was merged on the first invocation can be lost after a secondsetup-envrun in the same job. Consider persisting the originalBASH_ENVin a separate env var (written once to$GITHUB_ENV) and always sourcing that, or merging from a saved copy of the previous helper to avoid both recursion and dropping prior content.
if [ -n "$PREV_BASH_ENV" ] && [ -f "$PREV_BASH_ENV" ] && [ "$PREV_BASH_ENV" != "$RETRY_HELPER" ]; then
{
echo "source \"$PREV_BASH_ENV\""
cat "$RETRY_HELPER"
} > "${RETRY_HELPER}.merged"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes a release pipeline regression where
setup-envcould crash with exit 139 when invoked multiple times in the same job.The retry-helper
BASH_ENVmerge now avoids self-referencing recursion, and changelogs are updated for issue tracking on release0.3.1.Type of Change
feat-- New featurefix-- Bug fixdocs-- Documentation onlychore-- Maintenance task (deps, config, etc.)refactor-- Code restructuring (no behavior change)test-- Adding or updating testsci-- CI/CD pipeline changesbuild-- Build system or dependency changesrevert-- Reverts a previous commitstyle-- Code style (formatting, whitespace)Modifiers
!) -- This change breaks backward compatibilityChanges Made
.github/actions/setup-env/action.ymlPREV_BASH_ENValready equalsRETRY_HELPERsetup-env-retry.shfrom sourcing itself recursively on repeated setup invocationsCHANGELOG.mdFixedentry for issue#374in## [0.3.1] - TBDassets/workspace/.devcontainer/CHANGELOG.md#374Changelog Entry
Fixed
.github/actions/setup-env/action.ymlto skip merging whenPREV_BASH_ENValready equalsRETRY_HELPERsourcerecursion and exit 139 crashes whensetup-envis invoked multiple times in one jobTesting
just test)Manual Testing Details
N/A
Checklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
This addresses a regression chain related to the earlier
uv syncstabilization work in#370/#371; root cause and implementation plan were documented on issue#374comments before this patch.Refs: #374, #370