From 6d686b9bcc7e60c97997b7a2b2bda4261bc7a23e Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Sun, 26 Oct 2025 19:56:54 -0700 Subject: [PATCH] use env vars for inputs --- .github/workflows/release-lambda.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-lambda.yml b/.github/workflows/release-lambda.yml index d390b1836..9cd9eeaea 100644 --- a/.github/workflows/release-lambda.yml +++ b/.github/workflows/release-lambda.yml @@ -28,8 +28,10 @@ jobs: steps: - name: Set up regions matrix id: set-matrix + env: + AWS_REGIONS: ${{ github.event.inputs.aws_region }} run: | - IFS=',' read -ra REGIONS <<< "${{ github.event.inputs.aws_region }}" + IFS=',' read -ra REGIONS <<< "$AWS_REGIONS" MATRIX="[" for region in "${REGIONS[@]}"; do trimmed_region=$(echo "$region" | xargs) @@ -204,8 +206,11 @@ jobs: id: commit run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - name: Create Release Notes + env: + VERSION: ${{ github.event.inputs.version }} + SHA_SHORT: ${{ steps.commit.outputs.sha_short }} run: | - echo "AWS OpenTelemetry Lambda Layer for Python version ${{ github.event.inputs.version }}-${{ steps.commit.outputs.sha_short }}" > release_notes.md + echo "AWS OpenTelemetry Lambda Layer for Python version $VERSION-$SHA_SHORT" > release_notes.md echo "" >> release_notes.md echo "" >> release_notes.md echo "See new Lambda Layer ARNs:" >> release_notes.md @@ -219,10 +224,10 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token run: | gh release create --target "$GITHUB_REF_NAME" \ - --title "Release lambda-v${{ github.event.inputs.version }}-${{ steps.commit.outputs.sha_short }}" \ + --title "Release lambda-v$VERSION-$SHA_SHORT" \ --notes-file release_notes.md \ --draft \ - "lambda-v${{ github.event.inputs.version }}-${{ steps.commit.outputs.sha_short }}" \ + "lambda-v$VERSION-$SHA_SHORT" \ layer_arns.tf layer.zip echo Removing release_notes.md ... rm -f release_notes.md