Skip to content

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

License

Notifications You must be signed in to change notification settings

hayawata3626/team-approval-checker

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date
Mar 20, 2025
Nov 14, 2023
Dec 31, 2023
Dec 31, 2023
Dec 31, 2023
Dec 31, 2023
Nov 14, 2023
Oct 11, 2023
Oct 11, 2023
Oct 11, 2023
Oct 11, 2023
Oct 11, 2023
Dec 31, 2023
Jan 24, 2024
Oct 11, 2023
Oct 22, 2023
Oct 22, 2023
Mar 12, 2025
Mar 12, 2025
Oct 11, 2023

Repository files navigation

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