Homebrew / actions

🚀 Homebrew's GitHub Actions
BSD 2-Clause "Simplified" License
122 stars 39 forks source link

limit-pull-requests checks PR count by who triggers the workflow rather than PR author #603

Open karaarda opened 2 weeks ago

karaarda commented 2 weeks ago

github.context.actor is the initiator of the workflow. To get the original author of the PR github.context.payload.user.login should be user. Please refer to https://github.com/orgs/community/discussions/25502.

@ZhongRuoyu

ZhongRuoyu commented 2 weeks ago

Thanks for reporting; technically you're right, but is there a case where there is actual difference between the two, given that its intended use case is when github.event_name == 'pull_request_target' && github.event.action == 'opened'?

karaarda commented 1 week ago

Well, its intended use case is not documented and as this is a public repository anyone can include this action in their workflows like I did. It didn't play well in our approach where we would like to run our checks on 'opened', 'reopened' and 'synchronize'

Also if it is only ran on 'opened', doesn't it mean that one can just reopen the repo to walk around the PR limit?

I can open a PR with the fix if you agree it is a potential bug

MikeMcQuaid commented 1 week ago

I can open a PR with the fix if you agree it is a potential bug

Reviewing a PR will be easier to discuss, yes, please 👍🏻