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: add require multiple reviewers action #204

Merged
merged 5 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
28 changes: 7 additions & 21 deletions .github/actions/require-multiple-reviewers-v1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ A GitHub Action that requires multiple reviewers for important files

## Inputs

| Name | Required | Description | Default |
| ---------------------- | -------- | ---------------------------------------------------------- | ------- |
| `token` | Yes | A GitHub token with the required permissions | NA |
| `number-of-reviewers` | Yes | The number of reviewers required. | 2 |
| `changed-files-path` | Yes | The path to the file containing a list of changed files. | NA |
| `important-files-path` | Yes | The path to the file containing a list of important files. | NA |
| Name | Required | Description | Default |
| ---------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `token` | Yes | A GitHub token with the [required permissions](#permissions) | NA |
| `number-of-reviewers` | Yes | The number of reviewers required. | 2 |
| `important-files-path` | Yes | The path to the file containing a list of important files. It should comply with [gitignore syntax](https://git-scm.com/docs/gitignore). | NA |

## Example usage

Expand All @@ -21,28 +20,15 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 2
permissions:
pull-requests: write
pull-requests: read
contents: read
zlayaAvocado marked this conversation as resolved.
Show resolved Hide resolved
checks: write
steps:
zlayaAvocado marked this conversation as resolved.
Show resolved Hide resolved
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Fetch all branches
run: git fetch --all

- name: Get changed files for the entire PR
run: |
# Get the changed files by comparing base and head branches
git diff --name-only origin/${{ github.event.pull_request.base.ref }}...origin/${{ github.event.pull_request.head.ref }} > .github/changed-files.txt

- name: Require two reviewers for important files
uses: dequelabs/axe-api-team-public/.github/actions/require-multiple-reviewers-v1@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
zlayaAvocado marked this conversation as resolved.
Show resolved Hide resolved
number-of-reviewers: 2
changed-files-path: .github/changed-files.txt
important-files-path: .github/important-files.txt
```

Expand Down
5 changes: 1 addition & 4 deletions .github/actions/require-multiple-reviewers-v1/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ inputs:
description: 'The number of reviewers required.'
required: true
default: '2'
changed-files-path:
description: 'The path to the file containing a list of changed files.'
required: true
important-files-path:
description: 'The path to the file containing a list of important files.'
description: 'The path to the file containing a list of important files (gitignore syntax supported).'
required: true

runs:
Expand Down

This file was deleted.

Loading
Loading