Repository navigation
ci: validate dispatch inputs in the release workflows - #5998
Open
dreamorosi wants to merge 3 commits into
Open
dreamorosi wants to merge 3 commits into
dreamorosi wants to merge 3 commits into
Conversation
The SSM, partition verification and layer publishing workflows inserted dispatch inputs into run scripts or passed them unquoted. Inputs now reach scripts through env and are checked before they're used: layer versions must be numbers, and the layer build only runs for a semantic version that is published on npm. The git tag and docs version steps get the same treatment, and the SSM job drops contents: write, which it never used. Refs #5996
The PROD layer deploy was the only release job without a deployment environment. It now runs in layer-prod, like the other layer workflows, so the environment's protection rules apply to it. BETA deploys run without an environment, as before.
svozza
approved these changes
Nov 20, 2026
This branch has not been 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.
Summary
Changes
This PR covers step 1 of #5996, the optional cleanups, and the deployment environment for the PROD layer deploy. The release workflows inserted dispatch inputs into
run:scripts, where GitHub substitutes them before bash parses the script, or passed them unquoted. Inputs now reach every script throughenv:, and each one is checked before any AWS call or install uses it. Valid inputs produce the same commands as before.update_ssm.yml:layer-versionand the region are passed throughenv:, and the job fails unlesslayer-versionmatches^[0-9]+$.write-latestuses$PREFIXinstead of${{ env.prefix }}. The job, and its caller inpublish_layer.yml, dropcontents: write, which they never used.layers_partition_verify.yml: the resolved version is checked against^[0-9]+$in thepartition_versionstep and passed toVerify Layerthroughenv:. It still falls back toversionwhenpartition_versionis empty.publish_layer.yml: a new step before synth requires a semantic version (^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$) and checks thatnpm view "@aws-lambda-powertools/commons@<version>" versionreturns the same string. The version is quoted in the synth command. As the issue asks, it isn't compared with the checked-outpackage.json, so manual rebuilds of an earlier release still work.make-release.yml: the tag step readsRELEASE_VERSIONfromenv:.reusable_publish_docs.yml: the version must bemainor a semantic version after removing a leadingv.on_doc_merge.ymlpassesmain.reusable_deploy_layer_stack.yml: the PROD run ofdeploy-cdk-stacknow runs in thelayer-prodenvironment, like the other layer workflows, so the environment's protection rules apply to it. BETA runs without an environment, as before.Checked:
2.36.0, layer version51), match the commands in that run's logs.51,2.36.0,2.0.0-beta.1,v2.36.0andmain, and reject empty values,latest,npm:aliases, paths and values with spaces or;.npm viewexits non-zero for a version that isn't published.actionlintreports no issues on the changed files.Issue number: closes #5996
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.