Closed akshatagarwl closed 5 months ago
Golangci-lint is already triggered when a PR is created or updated.
Documentation about pull_request_review
event.
- prevent any malicious code from triggering your GitHub Actions
This should be handled inside the GitHub repository configuration. https://docs.github.com/en/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks
- cuts down the total billable minutes (since you're only running lints on pull request approvals and not on every update to the PR)
This only applies to private repositories so your first argument doesn't fit.
Anyway, pull_request_review
is not for approval but for reviews.
Even if you restrict only on approval (i.e. submitted
+ if: github.event.review.state == 'APPROVED'
), this means you will approve a PR without having the result of the linting, this doesn't make sense.
If you think of another activity type (ex: edited
), it's the same thing but worse.
To cut down the total billable minutes:
You want to launch golangci-lint on demand but your proposal (pull_request_review
) is a bad approach.
You want to launch golangci-lint on demand but your proposal (pull_request_review) is a bad approach.
@ldez Would love to hear any alternatives you have in mind
Welcome
Your feature request related to a problem? Please describe.
Currently the
only-new-issues
only supports a few event types likepull_request
,pull_request_target
,push
,merge_group
. Thepull_request_review
event is sometimes used to trigger CI only when the pull request is approved (using with types: submitted). This comes with a few benefits:Describe the solution you'd like.
support the
pull_request_review
type (could be confined to a few types like submitted, edited etc)Additional context.
ref: https://github.com/golangci/golangci-lint-action/pull/1059