In this tutorial, you will set up Digger to automate terraform pull requests using Github Actions and GCP.
In GitHub repository settings, go to Secrets and Variables - Actions. Create the following secrets:
GCP_CREDENTIALS
- contents of your GCP Service Account Key json fileDIGGER_TOKEN
- your Digger token (cloud or self-hosted)This file contains Digger configuration and needs to be placed at the root level of your repository. Assuming your terraform code is in the prod
directory:
Place it at .github/workflows/digger_workflow.yml
(name is important!)
This file defines a workflow with 5 steps:
create_credentials_file: true
option; without it, subsequent steps that rely Application Default Credentials will not work.gcloud info
DIGGER_TOKEN
needs to be set as a secret in Actions (either repository secret, or environment secret)Make any change to your terraform code e.g. add a blank line. An action run should start (you can see log output in Actions). After some time you should see output of Terraform Plan added as a comment to your PR:
Then you can add a comment like digger apply
and shortly after apply output will be added as comment too.
In this tutorial, you will set up Digger to automate terraform pull requests using Github Actions and GCP.
In GitHub repository settings, go to Secrets and Variables - Actions. Create the following secrets:
GCP_CREDENTIALS
- contents of your GCP Service Account Key json fileDIGGER_TOKEN
- your Digger token (cloud or self-hosted)This file contains Digger configuration and needs to be placed at the root level of your repository. Assuming your terraform code is in the prod
directory:
Place it at .github/workflows/digger_workflow.yml
(name is important!)
This file defines a workflow with 5 steps:
create_credentials_file: true
option; without it, subsequent steps that rely Application Default Credentials will not work.gcloud info
DIGGER_TOKEN
needs to be set as a secret in Actions (either repository secret, or environment secret)Make any change to your terraform code e.g. add a blank line. An action run should start (you can see log output in Actions). After some time you should see output of Terraform Plan added as a comment to your PR:
Then you can add a comment like digger apply
and shortly after apply output will be added as comment too.