-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tobiasz Kędzierski
committed
Oct 26, 2020
1 parent
ab32655
commit 47b5dec
Showing
6 changed files
with
328 additions
and
47 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
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 |
---|---|---|
|
@@ -13,26 +13,73 @@ | |
- [Inputs and outputs](#inputs-and-outputs) | ||
- [Inputs](#inputs) | ||
- [Outputs](#outputs) | ||
- [Examples](#examples) | ||
- [Workflow Run event](#workflow-run-event) | ||
- [Development environment](#development-environment) | ||
- [License](#license) | ||
|
||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
|
||
# Context and motivation | ||
|
||
TODO | ||
Label When Approved is an action that checks is Pull Request is approved and assign label to it. | ||
Label is not set or removed when Pull Request has awaiting requested changes. | ||
|
||
Setting label is optional that only output can be used in the workflow. | ||
|
||
The required input `require_committers_approval` says is approval can be done by people with read access to the repo | ||
or by anyone. It may be useful in repositories which requires committers approvals like [Apache Software Foundation](https://github.com/apache/) | ||
projects. | ||
|
||
# Inputs and outputs | ||
|
||
## Inputs | ||
|
||
| Input | Required | Default | Comment | | ||
|-------------------------|----------|--------------|-----------------------------------------------------------------------------------------------------| | ||
| `token` | yes | | The github token passed from `${{ secrets.GITHUB_TOKEN }}` | | ||
| Input | Required | Example | Comment | | ||
|-------------------------------|----------|-------------------------------|-------------------------------------------------------------------------| | ||
| `token` | yes | `${{ secrets.GITHUB_TOKEN }}` | The github token passed from `${{ secrets.GITHUB_TOKEN }}` | | ||
| `label` | no | `Approved by committers` | Label to be added/removed to the Pull Request if approved/not approved | | ||
| `require_committers_approval` | no | `true` | Is approval from user with write permission required | | ||
|
||
## Outputs | ||
|
||
TODO | ||
| Output | | | ||
|----------------|------------------------------| | ||
| `isApproved` | is Pull Reqeuest is approved | | ||
| `labelSet` | is label was set | | ||
| `labelRemoved` | is label was removed | | ||
|
||
# Examples | ||
|
||
### Workflow Run event | ||
|
||
```yaml | ||
name: Label when approved | ||
on: pull_request_review | ||
|
||
jobs: | ||
|
||
label-when-approved: | ||
name: "Label when approved" | ||
runs-on: ubuntu-latest | ||
outputs: | ||
isApprovedByCommiters: ${{ steps.label-when-approved-by-commiters.outputs.isApproved }} | ||
isApprovedByAnyone: ${{ steps.label-when-approved-by-anyone.outputs.isApproved }} | ||
steps: | ||
- name: Label when approved by commiters | ||
uses: TobKed/[email protected] | ||
id: label-when-approved-by-commiters | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
label: 'ready to merge (committers)' | ||
require_committers_approval: 'true' | ||
- name: Label when approved by anyone | ||
uses: TobKed/[email protected] | ||
id: label-when-approved-by-anyone | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
``` | ||
## Development environment | ||
|
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
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
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
Oops, something went wrong.