-
Notifications
You must be signed in to change notification settings - Fork 3
Add independent peer review validation workflow #64
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
Open
AndrewGable
wants to merge
17
commits into
main
Choose a base branch
from
andrew-validate-independent-peer-review
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
731d00c
Add independent peer review validation workflow
AndrewGable aba7b19
Use GitHub App client ID for peer review check
AndrewGable 2d2a6c9
Use GraphQL for peer review validation
AndrewGable 89bebf1
Simplify peer review validation helpers
AndrewGable e72fba8
Add newline
AndrewGable f473b3b
Hard-code OS Botify app ID
AndrewGable 23b2a2c
use client-id
AndrewGable 61d554c
Fix OS Botify token permissions
AndrewGable 0b48d74
Rename peer review workflow
AndrewGable e57f967
Rename peer review verifier
AndrewGable b6aea85
Clarify peer review failures
AndrewGable 2d8ce9c
Test informational peer review checks
AndrewGable 4bee49d
Undo draft
AndrewGable 1d3a559
Show informational peer review failures
AndrewGable 74415cd
Restore hard peer review failure
AndrewGable 74efe1d
Pass peer review check before approval
AndrewGable 72a99fd
Use Melvin app for peer review check
AndrewGable File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,52 @@ | ||
| # Note: This workflow is configured to run on all pull requests throughout the Expensify org, not just this repo. | ||
| # That has a few consequences: | ||
| # - We need to checkout the repo it's running on, and not just the GitHub-Actions repo | ||
| # - branch and path matching does not work in the workflow layer. From the docs: https://docs.github.com/en/enterprise-cloud@latest/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets#supported-event-triggers | ||
| # > Any filters you specify for the supported events are ignored - for example, branches, branches-ignore, paths, types and so on. The workflow is only triggered, and is always triggered, by the default activity types of the supported events | ||
| name: Verify peer review | ||
| run-name: Verify peer review for ${{ github.repository }}#${{ github.event.pull_request.number }} | ||
|
|
||
| on: pull_request | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
|
|
||
| jobs: | ||
| verifyPeerReview: | ||
| name: Check independent approval | ||
| runs-on: blacksmith-2vcpu-ubuntu-2404 | ||
| steps: | ||
| # v3.1.1 | ||
| - name: Generate a GitHub App token | ||
| id: generateAppToken | ||
| uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 | ||
| with: | ||
| app-id: '179547' | ||
| private-key: ${{ secrets.MELVIN_APP_PRIVATE_KEY }} | ||
| owner: ${{ github.repository_owner }} | ||
| repositories: | | ||
| ${{ github.event.repository.name }} | ||
| GitHub-Actions | ||
| permission-contents: read | ||
| permission-members: read | ||
| permission-metadata: read | ||
| permission-pull-requests: read | ||
|
|
||
| - name: Checkout repos | ||
| id: repo | ||
| uses: Expensify/GitHub-Actions/checkoutRepoAndGitHubActions@main | ||
|
|
||
| # v4.3.0 | ||
| - name: Setup Node | ||
| uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e | ||
|
|
||
| - name: Install npm packages | ||
| run: npm ci | ||
| working-directory: GitHub-Actions | ||
|
|
||
| - name: Verify peer review | ||
| run: npm run verify-peer-review | ||
| working-directory: GitHub-Actions | ||
| env: | ||
| GITHUB_TOKEN: ${{ steps.generateAppToken.outputs.token }} | ||
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you also need
permission-administration: readin order to read branch protection rules.I noticed before this was switched to graphql that it is passing even with incorrect permissions. Ideally I think it should fail in this case