Harden variables.sh, remove eval, rename auto-merge workflow (High batch)#198
Merged
Merged
Conversation
cloudofficer-admin
approved these changes
May 17, 2026
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.
Summary
Remediates three High-tier findings from
docs/code-review.md.variables.shran with no error handling, five action sites executed input strings viaeval/bash -c, and the auto-merge workflow was misnamed (it only approves).Key changes:
variables/variables.sh): addset -euo pipefailscoped tomain()(so sourcing for the test suite is unaffected); initialiseTAG, add:-defaults for runner env vars fornounsetsafety, replacegit … | head -n 1with capture-then-strip so a git failure is no longer masked underpipefail, and make the linter-detection helpers return 0 so an absent config file is a no-op rather than aset -eabort.aws/action.yml,linters/phpcs/action.yml,linters/phpstan/action.yml): replace the fiveeval "${VAR}"/bash -c "${VAR}"sites withbash -c -- "${VAR}"..github/workflows/auto-merge.yml→.github/workflows/auto-approve.yml): regenerated from the patched github-build generator (companion PR Rename auto-merge workflow to auto-approve and remove legacy file (CI-002) github-build#387). The legacyauto-merge.ymlis deleted and replaced byauto-approve.yml; the CI-001 fork guard, concurrency group, and AUTO-GENERATED header are carried over.Types of changes
Checklist
Further comments (if required)
Two consumer-visible changes. (1) BUG-004:
variables.shnow fails fast — a shallow clone, missing tag, or network blip that previously produced empty build vars and silently skipped a deploy will now fail the step. This is the intended correctness fix. (2) CI-002: the workflow file is renamed;auto-merge.ymlis removed andauto-approve.ymladded. Behaviour is unchanged (it still only approves code-owner PRs). Merge the companion `Cloud-Officer/github-build#387` so future regenerations stay in sync.