Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPSEXP-2775 Allow overriding the environment via input in terraform workflow #743

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
description: the terraform operation to perform (apply or destroy)
type: string
required: false
github_environment:
description: override the environment to apply the terraform operation to
type: string
required: false
secrets:
AWS_ACCESS_KEY_ID:
required: false
Expand Down Expand Up @@ -42,8 +46,11 @@ jobs:
environment="production"
elif [ "$BRANCH_LOWER" == "develop" ]; then
environment="develop"
elif [ -n "${{ inputs.github_environment }}" ]
then
environment="${{ inputs.github_environment }}"
else
echo "$BRANCH_LOWER doesn't have a matching environment"
echo "current branch doesn't have a matching environment and no environment override was provided"
exit 1
fi
echo "environment_name=${environment}" >> $GITHUB_OUTPUT
Expand Down
Loading