Skip to content

Commit

Permalink
[CI] Add action and workflow to check for semver label (#2814)
Browse files Browse the repository at this point in the history
# Motivation

We want to make sure every PR that gets merged is appropriately labeled.

# Modification

This PR adds a new workflow and action to check for a semver label to be present.

# Result

No more labeling after a PR got merged.
  • Loading branch information
FranzBusch authored Jul 31, 2024
1 parent de68e48 commit 883540f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/actions/pull_request_semver_label_checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: 'Pull request semver label checker'
description: 'Checks that at least one semver label is applied to the pull request'
runs:
using: "composite"
steps:
- name: Check labels
run: |
gh pr view ${{ github.event.number }} --repo apple/swift-nio --json labels \
| jq -e '[.labels[].name] | any(. == "semver/major" or . == "semver/minor" or . == "semver/patch" or . == "semver/none")'
14 changes: 14 additions & 0 deletions .github/workflows/pull_request_label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: PR

on:
pull_request:
types: [labeled, unlabeled]

jobs:
semver-label-check:
name: Semver label check
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: Check for semver label
uses: ./github/actions/pull_request_label_checker.yml

0 comments on commit 883540f

Please sign in to comment.