Skip to content
play

GitHub Action

Team Approval Checker

v1.2.0 Latest version

Team Approval Checker

play

Team Approval Checker

Checks approvals based on conditions

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Team Approval Checker

uses: hayawata3626/team-approval-checker@v1.2.0

Learn more about this action in hayawata3626/team-approval-checker

Choose a version

team-approval-checker

This GitHub Action checks the approvals for a pull request based on specified conditions.

Inputs

conditions

Required: A JSON string of approval conditions.

github-token

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.

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/team-approval-checker@v1.0.8
        with:
          conditions:
            '[{"team": "team1", "minimumCount": 3}, {"team": "team2",
            "minimumCount": 2}]'
          github-token: ${{ steps.generate_token.outputs.token }}