Skip to content

Commit 3cc167a

Browse files
committed
use env vars for workflow
1 parent 93d62fc commit 3cc167a

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

.github/workflows/release-build.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@ jobs:
8181
steps:
8282
- name: Set up regions matrix
8383
id: set-matrix
84+
env:
85+
AWS_REGIONS: ${{ github.event.inputs.aws_region }}
8486
run: |
85-
IFS=',' read -ra REGIONS <<< "${{ github.event.inputs.aws_region }}"
87+
IFS=',' read -ra REGIONS <<< "$AWS_REGIONS"
8688
MATRIX="["
8789
for region in "${REGIONS[@]}"; do
8890
trimmed_region=$(echo "$region" | xargs)
@@ -341,6 +343,7 @@ jobs:
341343
id: create_release
342344
env:
343345
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
346+
VERSION: ${{ github.event.inputs.version }}
344347
run: |
345348
# Generate dependency versions from package.json
346349
DEPS=$(node -e "
@@ -353,10 +356,11 @@ jobs:
353356
354357
# Extract CHANGELOG entries for this version
355358
CHANGELOG_ENTRIES=$(python3 -c "
356-
import re
359+
import re, os
360+
version = os.environ['VERSION']
357361
with open('CHANGELOG.md', 'r') as f:
358362
content = f.read()
359-
version_pattern = r'## v${{ github.event.inputs.version }}.*?\n(.*?)(?=\n## |\Z)'
363+
version_pattern = rf'## v{re.escape(version)}.*?\n(.*?)(?=\n## |\Z)'
360364
version_match = re.search(version_pattern, content, re.DOTALL)
361365
if version_match:
362366
entries = version_match.group(1).strip()
@@ -375,14 +379,14 @@ jobs:
375379
## Release Artifacts
376380
377381
This release publishes to public ECR and NPM.
378-
* See ADOT node auto-instrumentation Docker image v${{ github.event.inputs.version }} in our public ECR repository:
382+
* See ADOT node auto-instrumentation Docker image v$VERSION in our public ECR repository:
379383
https://gallery.ecr.aws/aws-observability/adot-autoinstrumentation-node
380-
* See version ${{ github.event.inputs.version }} in our NPM repository:
384+
* See version $VERSION in our NPM repository:
381385
https://www.npmjs.com/package/@aws/aws-distro-opentelemetry-node-autoinstrumentation
382386
383387
## Lambda Layer
384388
385-
This release includes the AWS OpenTelemetry Lambda Layer for JavaScript version ${{ github.event.inputs.version }}-$(echo $GITHUB_SHA | cut -c1-7).
389+
This release includes the AWS OpenTelemetry Lambda Layer for JavaScript version $VERSION-$(echo $GITHUB_SHA | cut -c1-7).
386390
387391
Lambda Layer ARNs:
388392
${{ needs.generate-lambda-release-note.outputs.layer-note }}
@@ -392,10 +396,10 @@ jobs:
392396
shasum -a 256 layer.zip > layer.zip.sha256
393397
394398
gh release create --target "$GITHUB_REF_NAME" \
395-
--title "Release v${{ github.event.inputs.version }}" \
399+
--title "Release v$VERSION" \
396400
--notes-file release_notes.md \
397401
--draft \
398-
"v${{ github.event.inputs.version }}" \
402+
"v$VERSION" \
399403
${{ env.ARTIFACT_NAME }} \
400404
${{ env.ARTIFACT_NAME }}.sha256 \
401405
layer.zip \

0 commit comments

Comments
 (0)