[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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

ci: detect Spam pull requests in GitHub Actions #5480

Closed
wants to merge 2 commits into from

Conversation

aminya
Copy link
@aminya aminya commented Feb 14, 2024

This adds a GitHub Action that for the new contributors checks if the PR has a meaningful description and doesn't contain the default text. Otherwise, they are detected as spam and are closed.

This adds a GitHub Action that for the new contributors checks if the PR has a meaningful description and doesn't contain the default text. Otherwise, they are detected as spam and are closed.
@MaffooBristol
Copy link

This is remarkably petty but it's "rationale" not "rational".

@wesleytodd
Copy link
Member

Hey @aminya, thanks for the PR. We I have been discussing this in #5449 and the consensus is we don't want an action for this if we can avoid it. We are still working on a few more important things for the project and will loop back around in that issue when we are ready. I just don't want you wasting your own time in this until we decide if an action is the right way to go.

Copy link
@ADTC ADTC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should work, actually. But we need a much bigger pull request template. One that both keeps necessary stuff (like a few mandated headings) and removes unnecessary stuff (like a comment in between that says it should be removed, and headings kept, or the PR could be closed). That way, someone who removes the entire template with a "Select All" would be caught because the headings would be missing.

@wesleytodd After fixing, couldn't we merge this in temporarily to auto-close spam PRs, and even encourage legit PRs to have detailed descriptions? We can always revert it later, if it causes problems, doesn't solve the issue, or we find a better solution.

.github/workflows/spam.yml Outdated Show resolved Hide resolved
.github/pull_request_template.md Outdated Show resolved Hide resolved
@wesleytodd
Copy link
Member

@ADTC I stand by my comment above. We have a few more important things we will be discussing in tomorrows TC meeting and after we sort that out we can start addressing these more directly.

@Steveantor
Copy link

How about restricting README PRs to core maintainers only?

@ADTC
Copy link
ADTC commented Feb 14, 2024

How about restricting README PRs to core maintainers only?

I went through the spam PRs trying to determine a pattern. It's not always the same file. The misled students can pick any file at random. Most of the time, the commit made from GitHub interface is left in with the default subject line. But not always. Most of the time, it's one commit. But not always. The point is, we have to be careful how we identify spam to cover as much of it as possible, with as little false positives as possible.

owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pull_request.number,
body: "Closing this PR because it does not follow the contribution guidelines.",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably want to elaborate this a bit more by providing helpful links.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When they ignore the clear short message in the template, I am not sure adding more information helps

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This closing comment is fine. You don't need to add any links. Anyone worth their salt will know how to look up Contribution Guidelines in GitHub.

I'd suggest a longer PR template instead. One that really requires a person to read through the template and fill it out properly.

@animesh-chouhan
Copy link

I would suggest separating the script from the workflow and creating an action to make the code more maintainable. Something like this: https://github.com/animesh-chouhan/github-spamstop/blob/main/index.js

Also the pull_request_template can be made more extensive if we are adopting it: https://github.com/animesh-chouhan/github-spamstop/blob/main/.github/pull_request_template.md

@jonchurch
Copy link
Member

Closing as we've decided not go to go this direction, see #5449 (comment)

@jonchurch jonchurch closed this Mar 26, 2024
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.

8 participants