Setting up GCP + GH Actions
Let's create our first pull request with a change and see this in action:
- 3.In your repository settings > Actions ensure that the Workflow Read and Write permissions are assigned - This will allow the workflow to post comments on your PRs
- 4.Add environment variables into your Github Action Secrets (cloud keys are a requirement since digger needs to connect to your account for coordinating locks). Use this guide to get the value for it:
- 5.make a change in
main.tfand create a PR - this will create a lock
digger plan- terraform plan output will be added as comment. If you don't see a comment (bug) - check out job output
- 6.create another PR - plan or apply won’t work in this PR until the first lock is released
- 7.You should see
Locked by PR #1comment. The action logs will display "Project locked" error message.
- 8.Lets apply the first PR and merge it to unlock the flow for our colleagues
In this tutorial we reused an existing sample repository to set up our first collaborative terraform environment which allows us to collaborate with our team and run terraform changes safely without conflicts.