Closed venkatamutyala closed 4 months ago
โฑ๏ธ Estimated effort to review [1-5] | 1 |
๐งช Relevant tests | No |
๐ Security concerns | No |
โก Key issues to review | None |
Category | Suggestion | Score |
Best practice |
Improve the reliability of the boolean check in the GitHub Actions condition___ **Consider using thegithub.event.pull_request.merged attribute with a more reliable check for boolean values. In YAML, boolean expressions should be explicitly compared using a string to avoid misinterpretation by different parsers or changes in the GitHub Actions runner environment.** [action.yml [148]](https://github.com/GlueOps/github-actions-opentofu-continuous-delivery/pull/23/files#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6R148-R148) ```diff -if: github.event.pull_request.merged == true +if: ${{ github.event.pull_request.merged == 'true' }} ``` Suggestion importance[1-10]: 9Why: The suggestion improves the reliability of the boolean check by explicitly comparing the value as a string, which is a best practice in YAML to avoid misinterpretation by different parsers or changes in the GitHub Actions runner environment. | 9 |
PR Type
Bug fix
Description
action.yml
to trigger thetofu apply
action only when a pull request is merged, instead of when the branch ismain
.Changes walkthrough ๐
action.yml
Update condition to trigger `tofu apply` action on PR merge
action.yml
tofu apply
action.main
to checkingif the pull request is merged.