Skip to content

ci: validate dispatch inputs in the release workflows - #5998

Open
dreamorosi wants to merge 3 commits into
mainfrom
ci/release-workflow-input-validation
Open

dreamorosi wants to merge 3 commits into
mainfrom
ci/release-workflow-input-validation

Conversation

@dreamorosi

@dreamorosi dreamorosi commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Changes

Please provide a summary of what's being changed

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 through env:, 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-version and the region are passed through env:, and the job fails unless layer-version matches ^[0-9]+$. write-latest uses $PREFIX instead of ${{ env.prefix }}. The job, and its caller in publish_layer.yml, drop contents: write, which they never used.

  • layers_partition_verify.yml: the resolved version is checked against ^[0-9]+$ in the partition_version step and passed to Verify Layer through env:. It still falls back to version when partition_version is 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 that npm view "@aws-lambda-powertools/commons@<version>" version returns the same string. The version is quoted in the synth command. As the issue asks, it isn't compared with the checked-out package.json, so manual rebuilds of an earlier release still work.

  • make-release.yml: the tag step reads RELEASE_VERSION from env:.

  • reusable_publish_docs.yml: the version must be main or a semantic version after removing a leading v. on_doc_merge.yml passes main.

  • reusable_deploy_layer_stack.yml: the PROD run of deploy-cdk-stack now runs in the layer-prod environment, like the other layer workflows, so the environment's protection rules apply to it. BETA runs without an environment, as before.

Checked:

  • The changed commands, rendered with the inputs from the last release run (2.36.0, layer version 51), match the commands in that run's logs.
  • The patterns accept 51, 2.36.0, 2.0.0-beta.1, v2.36.0 and main, and reject empty values, latest, npm: aliases, paths and values with spaces or ;.
  • npm view exits non-zero for a version that isn't published.
  • actionlint reports 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.

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
@dreamorosi dreamorosi self-assigned this Nov 16, 2026
@powertools-for-aws-oss-automation powertools-for-aws-oss-automation Bot added the size/M PR between 30-99 LOC label Nov 16, 2026
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.
@dreamorosi
dreamorosi requested a review from svozza November 17, 2026 15:58

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M PR between 30-99 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maintenance: validate dispatch inputs and gate the PROD layer deploy in release workflows

2 participants