Skip to content

Commit a2bc87a

Browse files
committed
Store environemnt in local variable.
1 parent 070e95a commit a2bc87a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/deploy.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,16 @@ jobs:
3131
run: |
3232
# Set environment based on branch or workflow_dispatch selection.
3333
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
34-
echo "environment_name=${{ github.event.inputs.environment }}" >> "$GITHUB_OUTPUT"
34+
env_name="${{ github.event.inputs.environment }}"
3535
elif [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
36-
echo "environment_name=prod" >> "$GITHUB_OUTPUT"
36+
env_name="prod"
3737
elif [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then
38-
echo "environment_name=staging" >> "$GITHUB_OUTPUT"
38+
env_name="staging"
3939
else
4040
echo "Unsupported branch for deployment: ${{ github.ref }}"
4141
exit 1
4242
fi
43+
echo "environment_name=$env_name" >> "$GITHUB_OUTPUT"
4344
# Set SSM parameter based on environment
4445
if [[ "$env_name" == "staging" ]]; then
4546
echo "ssm_parameter=/asap-pdf/production/app/version" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)