forked from polkadot-fellows/runtimes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add review-bot to require fellows as reviewers
Created a Github Action that uses the [Review-Bot app](https://github.com/paritytech/review-bot) to require fellows to review pull requests before allowing the PR to be merged. The user's information is fetched always from the chain after every event. It looks in the fellows data for a field named GitHub and it extracts the handle from there. This resolves polkadot-fellows#7 (you can find more information about the request there) This uses [`pull_request_target`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target) for the event, not `pull_request`. This is a security measure so that an attacker doesn’t have access to the secrets.
- Loading branch information
Showing
2 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
rules: | ||
- name: CI Files | ||
condition: | ||
include: | ||
- ^\.github/.* | ||
type: basic | ||
minFellowsRank: 2 | ||
- name: Relay files | ||
condition: | ||
include: | ||
- ^relay\/kusama\/.* | ||
- ^relay\/polkadot\/.* | ||
exclude: | ||
- ^relay\/.+\.adoc$ | ||
type: basic | ||
minFellowsRank: 4 | ||
- name: System Parachain Files | ||
condition: | ||
include: | ||
- ^system-parachains\/.* | ||
type: basic | ||
minFellowsRank: 2 | ||
- name: Target Files | ||
condition: | ||
include: | ||
- ^target\/.* | ||
exclude: | ||
- 'README.md' | ||
type: basic | ||
minFellowsRank: 4 | ||
- name: General Files | ||
condition: | ||
include: | ||
- '.*' | ||
exclude: | ||
- ^relay\/kusama\/.* | ||
- ^relay\/polkadot\/.* | ||
- ^\.github/.* | ||
- ^system-parachains\/.* | ||
- ^target\/.* | ||
type: basic | ||
minFellowsRank: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Review PR | ||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- review_requested | ||
- review_request_removed | ||
- ready_for_review | ||
pull_request_review: | ||
|
||
permissions: | ||
contents: read | ||
checks: write | ||
|
||
jobs: | ||
review-approvals: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Generate token | ||
id: team_token | ||
uses: tibdex/github-app-token@v1 | ||
with: | ||
app_id: ${{ secrets.REVIEW_APP_ID }} | ||
private_key: ${{ secrets.REVIEW_APP_KEY }} | ||
- name: "Evaluates PR reviews and assigns reviewers" | ||
uses: paritytech/review-bot@v1.1.0 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
team-token: ${{ steps.team_token.outputs.token }} | ||
checks-token: ${{ steps.team_token.outputs.token }} |