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-2689 Add workflow_dispatch option for terraform #628

Merged
merged 9 commits into from
May 28, 2024
Merged

Conversation

pmacius
Copy link
Contributor

@pmacius pmacius commented May 28, 2024

Checklist

Description

@pmacius pmacius marked this pull request as ready for review May 28, 2024 07:51
@pmacius pmacius requested a review from a team as a code owner May 28, 2024 07:51
.github/workflows/terraform.yml Outdated Show resolved Hide resolved
docs/README.md Outdated Show resolved Hide resolved
@pmacius pmacius requested a review from gionn May 28, 2024 08:15
@@ -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'
Copy link
Member

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

Copy link
Contributor Author

@pmacius pmacius May 28, 2024

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.

Copy link
Member

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.

docs/README.md Outdated Show resolved Hide resolved
pmacius and others added 2 commits May 28, 2024 10:32
Co-authored-by: Giovanni Toraldo <[email protected]>
@pmacius pmacius requested a review from gionn May 28, 2024 08:41
.github/workflows/terraform.yml Outdated Show resolved Hide resolved
@@ -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'
Copy link
Member

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.

@pmacius pmacius requested a review from gionn May 28, 2024 09:05
@pmacius
Copy link
Contributor Author

pmacius commented May 28, 2024

@pmacius pmacius requested a review from gionn May 28, 2024 14:24
Copy link
Member

@gionn gionn left a 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

@pmacius pmacius requested a review from gionn May 28, 2024 14:37
@pmacius pmacius merged commit 7b2b5db into master May 28, 2024
3 checks passed
@pmacius pmacius deleted the OPSEXP-2689 branch May 28, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants