Skip to content

Conversation

dreamorosi
Copy link
Contributor

@dreamorosi dreamorosi commented Sep 22, 2025

Summary

Changes

Please provide a summary of what's being changed

This PR updates several workflows to use environment variables to temporarily store workflow inputs, before passing them to the command and expanding them as a string. For example, ${{ input.version }} now becomes $VERSION with the variable being stored under env.

The PR also adds double quotes in multiple places to ensure string expansion works as intended.

Please add the issue number below, if no issue is present the PR might get blocked and not be reviewed

Issue number: closes #4529


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.

@boring-cyborg boring-cyborg bot added the automation This item relates to automation label Sep 22, 2025
@dreamorosi dreamorosi requested a review from Copilot September 22, 2025 14:39
@pull-request-size pull-request-size bot added the size/M PR between 30-99 LOC label Sep 22, 2025
@dreamorosi dreamorosi self-assigned this Sep 22, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR sanitizes CI workflow inputs by replacing direct GitHub Actions input references in shell commands with environment variables, improving security by preventing potential injection attacks.

  • Replaces ${{ inputs.* }} expressions in shell commands with environment variables
  • Adds env blocks to define environment variables from workflow inputs
  • Updates shell commands to reference environment variables instead of direct inputs

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/update_ssm.yml Sanitizes SSM parameter names using PREFIX and PACKAGE_VERSION env vars
.github/workflows/run-e2e-tests.yml Sanitizes PR number input for GitHub CLI checkout command
.github/workflows/reusable_publish_docs.yml Sanitizes version input and replaces inline GitHub expressions in jq commands
.github/workflows/publish_layer.yml Sanitizes CDK context parameter using LAYER_VERSION env var
.github/workflows/layers_partitions.yml Sanitizes layer version inputs and environment checks
.github/workflows/layers_partition_verify.yml Sanitizes version and partition version inputs
.github/workflows/layer_balance.yml Sanitizes region and start_at inputs for balance command
.github/workflows/bootstrap_region.yml Sanitizes region input for CDK bootstrap and balance commands

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@dreamorosi dreamorosi requested a review from sdangol September 22, 2025 15:23
@pull-request-size pull-request-size bot added size/L PRs between 100-499 LOC and removed size/M PR between 30-99 LOC labels Sep 22, 2025
@dreamorosi dreamorosi marked this pull request as ready for review September 22, 2025 15:27
@dreamorosi
Copy link
Contributor Author

@sdangol you worked on the secrets access last, can you please check if Copilot's suggestions are appropriate? If not we can dismiss them together with the findings that might pop up after merging.

@sdangol
Copy link
Contributor

sdangol commented Sep 22, 2025

@dreamorosi Those are the same ones that we had discussed last time about the issue being mitigated by the use of environment specific secrets. So, the findings are a false positive.

@dreamorosi
Copy link
Contributor Author

Yes, I know, we had to revert them because the solution we came up with didn't work.

I was wondering if Copilot's solution is better and might work.

@sdangol
Copy link
Contributor

sdangol commented Sep 22, 2025

The suggested solution will need some adjustments to make it work like the checking for the CONVERTED_REGION value is wrong. Nonetheless, including the regions even just for the china and the gov cloud regions would make it very verbose.

@dreamorosi
Copy link
Contributor Author

Ok, thanks for checking - I remember you mentioning this in the previous iteration as well.

Happy to ignore the suggestions and merge whenever you're ready to approve (tomorrow after the release is fine).

Copy link

@dreamorosi dreamorosi merged commit e155e72 into main Sep 24, 2025
39 checks passed
@dreamorosi dreamorosi deleted the chore/ci_input_sanitization branch September 24, 2025 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation This item relates to automation size/L PRs between 100-499 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maintenance: change workflow inputs to always use env

2 participants