generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
1bb821c
commit eabcbaf
Showing
1 changed file
with
33 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,12 +13,40 @@ conditions. | |
|
||
**Required**: The GitHub token. | ||
|
||
This github actions will retrieve members in the organization, so please give | ||
the github token the appropriate permissions. | ||
|
||
## Usage | ||
|
||
This is an example: github apps is used to retrieve the token. See here for | ||
[details](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow). | ||
|
||
```yaml | ||
- name: Check Approvals | ||
uses: hayawata3626/[email protected] | ||
with: | ||
conditions: '[{"team": "team1", "minimumCount": 1}]' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
name: Check Team Approvals | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
check-team-approvals: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Generate a token | ||
id: generate_token | ||
uses: tibdex/github-app-token@v1 | ||
with: | ||
app_id: ${{ secrets.APP_ID }} | ||
private_key: ${{ secrets.PRIVATE_KEY }} | ||
|
||
- name: Run approval check | ||
uses: hayawata3626/[email protected] | ||
with: | ||
conditions: | ||
'[{"team": "team1", "minimumCount": 3}, {"team": "team2", | ||
"minimumCount": 2}]' | ||
github-token: ${{ steps.generate_token.outputs.token }} | ||
``` |