Skip to content

workflows/pr-receive: Ignore pull requests with 10 or more commits #66320

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

Merged
merged 2 commits into from
Sep 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/pr-receive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ permissions:
jobs:
pr-target:
runs-on: ubuntu-latest
if: github.repository == 'llvm/llvm-project'
# Ignore PRs with more than 10 commits. Pull requests with a lot of
# commits tend to be accidents usually when someone made a mistake while trying
# to rebase. We want to ignore these pull requests to avoid excessive
# notifications.
if: github.repository == 'llvm/llvm-project' &&
github.event.pull_request.commits < 10
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! Should we add github.event.pull_request.draft == false too ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, we could add that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think I'm going to add this in a separate pull request, because I want to write a separate commit message about ignoring drafts and I can't push more than two commits at once here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually, I think in order to add this, we would need to run this action when the Draft flag is removed from the PR, but I don't see an event for that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

PR for ignoring drafts: #66578

steps:
- name: Store PR Information
run: |
Expand Down