GlueOps / github-actions-opentofu-continuous-delivery

4 stars 0 forks source link

fix: apply so that it only runs when a PR is merged #24

Closed venkatamutyala closed 4 months ago

venkatamutyala commented 4 months ago

PR Type

Bug fix


Description


Changes walkthrough ๐Ÿ“

Relevant files
Bug fix
action.yml
Restrict `tofu apply` action to run only on PR merge to main

action.yml
  • Modified the condition for running the tofu apply step.
  • Added a check to ensure the action only runs when a PR is merged into
    the main branch.
  • +1/-1     

    ๐Ÿ’ก PR-Agent usage: Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    codiumai-pr-agent-free[bot] commented 4 months ago

    PR Reviewer Guide ๐Ÿ”

    โฑ๏ธ Estimated effort to review [1-5] 1
    ๐Ÿงช Relevant tests No
    ๐Ÿ”’ Security concerns No
    โšก Key issues to review None
    codiumai-pr-agent-free[bot] commented 4 months ago

    PR Code Suggestions โœจ

    CategorySuggestion                                                                                                                                    Score
    Best practice
    Use the toBoolean() function to ensure correct boolean interpretation ___ **Instead of directly comparing github.event.pull_request.merged to true, it is safer to use
    the toBoolean() function to ensure the value is correctly interpreted as a boolean. This
    avoids potential issues with type mismatches.** [action.yml [148]](https://github.com/GlueOps/github-actions-opentofu-continuous-delivery/pull/24/files#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6R148-R148) ```diff -if: github.ref_name == 'main' && github.event.pull_request.merged == true +if: github.ref_name == 'main' && github.event.pull_request.merged.toBoolean() ```
    Suggestion importance[1-10]: 9 Why: This suggestion improves the robustness of the code by ensuring that the value is correctly interpreted as a boolean, which can prevent potential issues with type mismatches.
    9