Skip to content

Commit

Permalink
feat(approvals-satisfied): add approvals-satisfied helper (#309)
Browse files Browse the repository at this point in the history
* feat(approvals-satisfied): add approvals-satisfied helper

* update readme

* ensure that each codeowner review is satisfied

* refactor

* refactor

* rename

* fix type issue

* dummy
  • Loading branch information
danadajian authored Dec 19, 2022
1 parent 11393af commit 3076bb7
Show file tree
Hide file tree
Showing 14 changed files with 525 additions and 22 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/approvals-satisfied.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Approvals Satisfied

on:
pull_request:
branches: [ main ]
paths:
- 'src/helpers/approvals-satisfied.ts'

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}

- uses: ./
id: approvals-satisfied
with:
helper: approvals-satisfied
github_token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}

- if: steps.approvals-satisfied.outputs.output == 'true'
run: echo "PR approvals have been satisfied!"
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,17 @@ Each of the following helpers are defined in a file of the same name in `src/hel
### [add-pr-approval-label](.github/workflows/add-pr-approval-label.yml)
* Upon PR review, adds a `CORE APPROVED` label if the reviewer is a part of the provided Github team, otherwise adds the `PEER APPROVED` label

### [approvals-satisfied](.github/workflows/approvals-satisfied.yml)
* Returns `true` if the PR has been approved by the specified GitHub team(s) and `false` otherwise
* If GitHub teams are omitted, uses `CODEOWNERS.md` to determine teams to use

### [approve-pr](.github/workflows/approve-pr.yml)
* Approves a PR
* Approves a PR

### [assign-pr-reviewers](.github/workflows/assign-pr-reviewers.yml)
* Randomly assigns members of a github team to review a PR. If `login` is provided, it does nothing if that user is already part of the team
* Randomly assigns members of the specified GitHub team(s) to review a PR.
* If GitHub teams are omitted, uses `CODEOWNERS.md` to determine teams to use
* If `login` is provided, it does nothing if that user is already part of the team
* You can also pass a `slack_webhook_url` to notify the assignees that they are assigned to the PR!

### [check-merge-safety](.github/workflows/check-merge-safety.yml)
Expand Down
13 changes: 9 additions & 4 deletions dist/153.index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/153.index.js.map

Large diffs are not rendered by default.

255 changes: 255 additions & 0 deletions dist/499.index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3076bb7

Please sign in to comment.