Skip to content

Commit

Permalink
docs: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hayawata3626 committed Oct 22, 2023
1 parent 1bb821c commit eabcbaf
Showing 1 changed file with 33 additions and 5 deletions.
38 changes: 33 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
```

0 comments on commit eabcbaf

Please sign in to comment.