From 144db2fba9ab15c3e1a77bfb775d4cf9e066d4ae Mon Sep 17 00:00:00 2001 From: 0marperez Date: Thu, 15 Feb 2024 12:55:22 -0500 Subject: [PATCH] Include PRs in jq command --- .github/scripts/run-codebuild-batch-job.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/scripts/run-codebuild-batch-job.sh b/.github/scripts/run-codebuild-batch-job.sh index 34bd9889b4c..f0f833f2fd1 100755 --- a/.github/scripts/run-codebuild-batch-job.sh +++ b/.github/scripts/run-codebuild-batch-job.sh @@ -13,14 +13,17 @@ SMITHY_PR=$4 echo "Starting CodeBuild project ${PROJECT_NAME}" -# dump all GITHUB_* environment variables to file and pass to start job -jq -n 'env | to_entries | [.[] | select(.key | startswith("GITHUB_"))] | [.[] | {name: .key, value:.value, type:"PLAINTEXT"}]' >/tmp/gh_env_vars.json +export SDK_PR +export SMITHY_PR + +# dump all GITHUB_* & *_PR environment variables to file and pass to start job +jq -n 'env | to_entries | [.[] | select((.key | startswith("GITHUB_")) or (.key | endswith("_PR")))] | [.[] | {name: .key, value:.value, type:"PLAINTEXT"}]' >/tmp/gh_env_vars.json START_RESULT=$( aws codebuild start-build-batch \ --project-name ${PROJECT_NAME} \ --source-version $SOURCE_VERSION \ - --environment-variables-override name=SDK_PR,value=$SDK_PR name=SMITHY_PR,value=$SMITHY_PR file:///tmp/gh_env_vars.json + --environment-variables-override file:///tmp/gh_env_vars.json ) if [ "$?" != "0" ]; then