Harden the release workflows against injected values - #139
Merged
erseco merged 1 commit intoSep 26, 2026
Merged
Conversation
Contributor
Test in WordPress PlaygroundTest the plugin with the code from this branch:
|
This was referenced Sep 26, 2026
erseco
force-pushed
the
feature/ci-harden-workflows
branch
from
September 26, 2026 07:20
dd8d8a3 to
d5649e7
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## hotfix/admin-preview-opaque-origin #139 +/- ##
=====================================================================
Coverage 96.87% 96.87%
Complexity 864 864
=====================================================================
Files 39 39
Lines 4324 4324
=====================================================================
Hits 4189 4189
Misses 135 135
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
erseco
added this pull request to stack #144
September 26, 2026 07:38
erseco
force-pushed
the
feature/ci-harden-workflows
branch
from
September 26, 2026 07:43
d5649e7 to
2cfb366
Compare
erseco
force-pushed
the
feature/ci-harden-workflows
branch
from
September 26, 2026 08:01
2cfb366 to
952aac1
Compare
check-editor-releases expanded the upstream release tag straight into shell steps of a job holding contents: write. The tag is now validated as a plain version tag and passed to later steps through env. release expanded workflow_dispatch inputs into the script and wrote them to GITHUB_ENV unchecked, where a newline would define arbitrary variables for every later step. Inputs are read through env and validated first. Both workflows build the editor from third-party packages, so actions/checkout no longer leaves the write token in .git/config; check-editor-releases hands it to its single push explicitly. Also apply the non-breaking npm audit fixes to the dev dependency tree.
erseco
force-pushed
the
feature/ci-harden-workflows
branch
from
September 26, 2026 08:29
952aac1 to
9bd0209
Compare
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.
Stacked on #138.
Workflow hardening
Two workflows expanded external values straight into shell scripts, inside jobs that hold a write token.
check-editor-releases.ymlexelearning/exelearningreleasetag_namewas expanded directly intorun:steps. This job holdscontents: writeandactions: write.^v[0-9][0-9A-Za-z.-]*$, and later steps read it throughenv:.release.ymlworkflow_dispatchinputs were expanded into the script and written toGITHUB_ENVunchecked. A newline in any of them would define arbitrary variables, such asBASH_ENV, for every later step.env:and validated first.actions/checkoutnow usespersist-credentials: false.check-editor-releasespasses the token only to its singlegit push.npm audit fixto the dev tree (21 → 17 advisories). The rest need major@wp-playground/wp-env bumps and are left to Dependabot.Not changed on purpose
composer.lock: it is gitignored, so CI already resolves the patched PHPCS, WPCS and PHPCSUtils releases.Verification
actionlintreports no errors. The only notices are the same 19 shellcheck info/style notices that were already reported before this change.