-
Notifications
You must be signed in to change notification settings - Fork 5
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-2689 Add workflow_dispatch option for terraform #628
Conversation
.github/workflows/terraform.yml
Outdated
@@ -111,7 +115,7 @@ jobs: | |||
|
|||
- name: Terraform plan | |||
uses: dflook/terraform-plan@0f4a5046f18698eee737a52d4cb11f56f2377a32 # v1.42.0 | |||
if: github.event_name == 'pull_request' | |||
if: github.event_name == 'pull_request' || inputs.terraform_operation == 'apply' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not needed, as per docs it would just print plan on stdout outside of a pull_request event, but then the apply would be immediately executed after - without using that
https://github.com/dflook/terraform-plan?tab=readme-ov-file#terraform-plan-action
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/dflook/terraform-github-actions/tree/main/terraform-apply
Without a plan apply will fail. Have to add auto_approve
option based on event name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it could still work if the latest commit is a PR with a plan attached to it - but in that case you could simply re-run the merge workflow run - no need to trigger this new workflow.
anyway could be good to have it in case we know we want to run an apply.
Co-authored-by: Giovanni Toraldo <[email protected]>
.github/workflows/terraform.yml
Outdated
@@ -111,7 +115,7 @@ jobs: | |||
|
|||
- name: Terraform plan | |||
uses: dflook/terraform-plan@0f4a5046f18698eee737a52d4cb11f56f2377a32 # v1.42.0 | |||
if: github.event_name == 'pull_request' | |||
if: github.event_name == 'pull_request' || inputs.terraform_operation == 'apply' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it could still work if the latest commit is a PR with a plan attached to it - but in that case you could simply re-run the merge workflow run - no need to trigger this new workflow.
anyway could be good to have it in case we know we want to run an apply.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bump version.txt to 5.27.0
Checklist
Description