jenkins, ci-automation: Drop POSIXLY_CORRECT from environment - #4300
Merged
Merged
Conversation
It wasn't in the environment on purpose, just a side effect of using `sh` instead of `bash`. Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
chewi
approved these changes
Oct 1, 2026
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Sourceable garbage collectors must retain protection against callers that export POSIXLY_CORRECT.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Prevents Jenkins jobs from inheriting an unintentionally generated POSIXLY_CORRECT variable.
Changes:
- Uses
bashwhen collecting exported environment variables. - Removes local
POSIXLY_CORRECTguards from garbage collectors.
| File | Description |
|---|---|
jenkins/systemd-run-wrap.sh |
Avoids generating POSIXLY_CORRECT. |
ci-automation/garbage_collect_releases.sh |
Removes AWK environment guards. |
ci-automation/garbage_collect_github_ci_sdk.sh |
Removes AWK environment guard. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| local purge_versions | ||
| mapfile -t purge_versions < <(unset POSIXLY_CORRECT; \ | ||
| mapfile -t purge_versions < <( |
| # For some reasons this is set to the empty string in some environments and it makes gawk | ||
| # behave like POSIX awk (i.e. no 'gensub'). | ||
| unset POSIXLY_CORRECT | ||
| local keep=$( |
This branch is waiting to be deployed
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.

It wasn't in the environment on purpose, just a side effect of using
shinstead ofbash.Should shut up all those sed warnings about not portable stuff from logs.