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

[GitHub CI] Add step to block PRs from forked repositories unless they have the right label #1627

Merged
merged 5 commits into from
Aug 20, 2019

Conversation

nguyenhuy
Copy link
Member

@nguyenhuy nguyenhuy commented Aug 20, 2019

Block pull requests from forked repositories that aren't from, and aren't labeled by, a maintainer.

@jparise
Copy link
Member

jparise commented Aug 20, 2019

Will the "label" action re-kick-off the failed build?

@nguyenhuy
Copy link
Member Author

It should according to the doc:

Triggered when a pull request is assigned, unassigned, labeled, unlabeled, opened, edited, closed, reopened, synchronize, ready_for_review, locked, unlocked or when a pull request review is requested or removed. See below to learn how this event works with forked repositories.

https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events

@ghost
Copy link

ghost commented Aug 20, 2019

🚫 CI failed with log

@nguyenhuy nguyenhuy changed the title [WIP][GitHub CI] Add approval step to PRs from forked repositories [GitHub CI] Add step to block PRs from forked repositories unless they have the right label Aug 20, 2019
@nguyenhuy
Copy link
Member Author

@jparise This is ready for review if you have a minute!

Copy link
Member

@jparise jparise left a comment

Choose a reason for hiding this comment

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

Nice idea!

@nguyenhuy
Copy link
Member Author

Thank you!

@nguyenhuy nguyenhuy merged commit beadc28 into TextureGroup:master Aug 20, 2019
@nguyenhuy nguyenhuy deleted the HN-Actions-PRs branch August 20, 2019 22:24
nguyenhuy added a commit to nguyenhuy/Texture that referenced this pull request Aug 21, 2019
In TextureGroup#1627 I introduced an approval step that is meant to block PRs from forked repos unless they're labeled as "CI approved" by a maintainer. Turned out it doesn't work. When a label is added, a pull_request event with "labeled" as its action is fired but GitHub CI didn't restart the workflow. My guess is it checked the PR's commit and branch and determined that nothing has changed. Here is what the doc says: "A workflow runs on a specific version of code in your repository, determined by the commit SHA and Git ref" (https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events).

This diff removes the label check so all PRs are automatically built. Here are the current usage limits in case we run into them: https://help.github.com/en/articles/workflow-syntax-for-github-actions#usage-limits
nguyenhuy added a commit that referenced this pull request Aug 21, 2019
In #1627 I introduced an approval step that is meant to block PRs from forked repos unless they're labeled as "CI approved" by a maintainer. Turned out it doesn't work. When a label is added, a pull_request event with "labeled" as its action is fired but GitHub CI didn't restart the workflow. My guess is it checked the PR's commit and branch and determined that nothing has changed. Here is what the doc says: "A workflow runs on a specific version of code in your repository, determined by the commit SHA and Git ref" (https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events).

This diff removes the label check so all PRs are automatically built. Here are the current usage limits in case we run into them: https://help.github.com/en/articles/workflow-syntax-for-github-actions#usage-limits
matthewd1234 pushed a commit to matthewd1234/Texture that referenced this pull request Aug 25, 2019
…y have the right label (TextureGroup#1627)

Block pull requests from forked repositories that aren't from, and aren't labeled by, a maintainer. Adding "CI approved" label will unblock them.
matthewd1234 pushed a commit to matthewd1234/Texture that referenced this pull request Aug 25, 2019
In TextureGroup#1627 I introduced an approval step that is meant to block PRs from forked repos unless they're labeled as "CI approved" by a maintainer. Turned out it doesn't work. When a label is added, a pull_request event with "labeled" as its action is fired but GitHub CI didn't restart the workflow. My guess is it checked the PR's commit and branch and determined that nothing has changed. Here is what the doc says: "A workflow runs on a specific version of code in your repository, determined by the commit SHA and Git ref" (https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events).

This diff removes the label check so all PRs are automatically built. Here are the current usage limits in case we run into them: https://help.github.com/en/articles/workflow-syntax-for-github-actions#usage-limits
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.

2 participants