Skip to content

Commit

Permalink
[CI] Fix label check (#2827)
Browse files Browse the repository at this point in the history
# Motivation

The label check workflow doesn't seem to work properly.

# Modification

This PR fixes it.

# Result

Proper label checks.
  • Loading branch information
FranzBusch authored Aug 5, 2024
1 parent 260c899 commit 4c4453b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
15 changes: 13 additions & 2 deletions .github/actions/pull_request_semver_label_checker/action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
name: 'Pull request semver label checker'
description: 'Checks that at least one semver label is applied to the pull request'
name: 'Pull request Semantic Version label checker'

description: 'Checks that at least one Semantic Version label is applied to the pull request'

inputs:
token:
description: 'A GitHub token'
type: string
default: ${{ github.token }}

runs:
using: "composite"
steps:
- name: Check labels
shell: bash
env:
GH_TOKEN: ${{ inputs.token }}
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")'
8 changes: 4 additions & 4 deletions .github/workflows/pull_request_label.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: PR
name: PR label

on:
pull_request:
types: [labeled, unlabeled]

jobs:
semver-label-check:
name: Semver label check
name: Semantic Version label check
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check for semver label
uses: ".github/actions/pull_request_semver_label_checker/action.yml"
- name: Check for Semantic Version label
uses: ./.github/actions/pull_request_semver_label_checker/

0 comments on commit 4c4453b

Please sign in to comment.