Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
check-circle

GitHub Action

Check PR Labels on Push

v1.0.5

Check PR Labels on Push

check-circle

Check PR Labels on Push

This action check if given ALL labels have be applied to the PR when pushed

Installation

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

              

- name: Check PR Labels on Push

uses: shioyang/[email protected]

Learn more about this action in shioyang/check-pr-labels-on-push-action

Choose a version

Check PR Labels on Push Action

This action check if given labels have be applied to the PR when pushed.

Inputs

github-token

Required The repository token, i.e. secrets.GITHUB_TOKEN

labels

Required The array of label name, e.g. '["label-1", "label-2"]'

Outputs

result

The result if given labels have be applied to the PR

Example Usage

uses: shioyang/[email protected]
with:
  github-token: ${{ secrets.GITHUB_TOKEN }}
  labels: '["label-1", "label-2"]'

Example Workflow

e.g. .github/workflows/main.yml

on:
  push:
    branches:
      - master

jobs:
  check_pr_labels_job:
    runs-on: ubuntu-latest
    name: A job to check the PR labels contain given labels
    steps:
    - name: Check PR labels action step
      id: check_pr_labels
      uses: shioyang/[email protected]
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}
        labels: '["enhancement"]'
    - name: See result
      run: echo "${{ steps.check_pr_labels.outputs.result }}"