Skip to content

Latest commit

 

History

History
56 lines (45 loc) · 2.02 KB

File metadata and controls

56 lines (45 loc) · 2.02 KB

Check repository collaborator

A composite action that checks if a user is a collaborator with this repository. Requires the contents: write permission to work.

Inputs

Name Description Default
username (*) The handle for the GitHub user account. N/A
github-token The default token to use for this Git operation. If unspecified, this will default to github.token. "${{ github.token }}"
owner The repository owner. If unspecified, this will default to the owner of the current repository. ""
repo The name of the repository. If unspecified, this will default to the current repository. ""
retries The number of times to attempt to retry if this fails. "0"
retry-exempt-status-codes A list of error-codes that are exempt from being retried. "400,401,403,404,422"

Note: (*) marks required inputs

Outputs

Name Description
is-collaborator A boolean indicating whether the user is a collaborator

Example

Here is a very basic example of how to use the repos/check-collaborator composite action in a project (placeholders are used in place of real inputs):

run:
  example-job:
    # ... 
    steps:
      # ... 
      - name: Check repository collaborator
        id: repos-check-collaborator # only necessary if using this action's output
        uses: bitwizeshift/actions-github/repos/check-collaborator@v1
        with:
          # Required inputs
          username: USERNAME

          # Optional inputs
          github-token: GITHUB_TOKEN
          owner: OWNER
          repo: REPO
          retries: RETRIES
          retry-exempt-status-codes: RETRY_EXEMPT_STATUS_CODES
      # ... 
      - name: Uses "Check repository collaborator" Outputs
        uses: example-actions/use-repos-check-collaborator@v3 # illustrative
        with:
          use-is-collaborator: ${{ steps.repos-check-collaborator.outputs.is-collaborator }}