-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat(terraform): validate configuration if triggered by Dependabot #623
feat(terraform): validate configuration if triggered by Dependabot #623
Conversation
Hasn't been tested. |
Converting to draft until tested. |
@equinor/ops-actions-maintainers I've been unable to find a way to test this so far. I've tried to push commits as Dependabot (i.e. I've configured Git locally to commit as Dependabot), however in order to push to GitHub and trigger a workflow, you need to authenticate your account, so the commits are identified as mine anyway 🤷 I suggest we merge this PR, then either fix or revert this commit if it turns out to be broken. |
…#623)" The Terraform workflow currently throws an error if triggered by Dependabot and Dependabot secrets `AZURE_CLIENT_ID`, `AZURE_SUBSCRIPTION_ID` and/or `AZURE_TENANT_ID` are not configured, as these secrets are required by the Terraform workflow. There are two possible solutions to this issue: 1. Set these secrets as not required in the Terraform workflow. The downside of this solution is that it can cause confusion regarding the usage of the Terraform workflow, as these secrets are still required for normal use, they're just not marked as required to prevent this error when triggered by Dependabot. 2. Add these Dependabot secrets to the relevant repository and set the values to empty strings. This adds an, in my opinion, unnecessary and confusing prerequisite for the Terraform workflow. 3. Revert the commit that broke the Terraform workflow. Going for solution 3 keeps the Terraform workflow as simple as possible, so that is the solution that I've gone for. This reverts commit 9d552d9.
) Currently, if the Terraform workflow is triggered by Dependabot, both the `Terraform Plan` and `Terraform Apply` jobs are skipped, meaning the workflow does nothing. With thes changes, the workflow should run until at least the `Terraform Validate` step to catch obvious errors. If triggered by Dependabot, it's important that the Terraform backend is _not_ initialized when running `terraform init`, since that requires authentication to Azure, which Dependabot can't do.
) Currently, if the Terraform workflow is triggered by Dependabot, both the `Terraform Plan` and `Terraform Apply` jobs are skipped, meaning the workflow does nothing. With thes changes, the workflow should run until at least the `Terraform Validate` step to catch obvious errors. If triggered by Dependabot, it's important that the Terraform backend is _not_ initialized when running `terraform init`, since that requires authentication to Azure, which Dependabot can't do.
Currently, if the Terraform workflow is triggered by Dependabot, both the
Terraform Plan
andTerraform Apply
jobs are skipped, meaning the workflow does nothing 🤷 With the changes in this PR, the workflow should run until at least theTerraform Validate
step to catch obvious errors.If triggered by Dependabot, it's important that the Terraform backend is not initialized when running
terraform init
, since that requires authentication to Azure, which Dependabot can't do.