Add documentation for team approver (#39)
* Add documentation for team approver This feature is now tested and this PR adds the necessary documentation to show how to implement org team expansion for approvers. Signed-off-by: Thomas Stringer <thomas@trstringer.com> * fix action version Signed-off-by: Thomas Stringer <thomas@trstringer.com>
This commit is contained in:
parent
46dbdde656
commit
1e890961bd
1 changed files with 25 additions and 0 deletions
25
README.md
25
README.md
|
|
@ -38,6 +38,31 @@ steps:
|
|||
- `minimum-approvals` is an integer that sets the minimum number of approvals required to progress the workflow. Defaults to ALL approvers.
|
||||
- `issue-title` is a string that will be appened to the title of the issue.
|
||||
|
||||
## Org team approver
|
||||
|
||||
If you want to have `approvers` set to an org team, then you need to take a different approach. The default [GitHub Actions automatic token](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token) does not have the necessary permissions to list out team members. If you would like to use this then you need to generate a token from a GitHub App with the correct set of permissions.
|
||||
|
||||
Create a GitHub App with **read-only access to organization members**. Once the app is created, add a repo secret with the app ID. In the GitHub App settings, generate a private key and add that as a secret in the repo as well. You can get the app token by using the [`tibdex/github-app-token`](https://github.com/tibdex/github-app-token) GitHub Action:
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
myjob:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Generate token
|
||||
id: generate_token
|
||||
uses: tibdex/github-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.APP_PRIVATE_KEY }}
|
||||
- name: Wait for approval
|
||||
uses: trstringer/manual-approval@v1
|
||||
with:
|
||||
secret: ${{ steps.generate_token.outputs.token }}
|
||||
approvers: myteam
|
||||
minimum-approvals: 1
|
||||
```
|
||||
|
||||
## Timeout
|
||||
|
||||
If you'd like to force a timeout of your workflow pause, you can specify `timeout-minutes` at either the [step](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepstimeout-minutes) level or the [job](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idtimeout-minutes) level.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue