Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@

## How to test the changes (if needed)
- (How should a reviewer test this functionality.)

## Labels
Please add exactly one of the following labels to this PR:
- `breaking-change` — This PR introduces a breaking change to the public API
- `non-breaking-change` — This PR does not break any existing functionality

The label check CI job will fail until one of these labels is applied.
3 changes: 3 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
changelog:
categories:
- title: Breaking Changes
labels:
- breaking-change
- title: New Features
labels:
- connector-update
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/label-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Label Check

on:
pull_request:
types: [opened, reopened, ready_for_review, labeled, unlabeled, synchronize]

permissions: read-all

jobs:
label-check:
if: github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest

permissions:
pull-requests: read

steps:
- uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
github.com:443

- name: Check for required labels
env:
LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }}
run: |
HAS_BREAKING=$(echo "$LABELS" | jq 'map(select(. == "breaking-change")) | length')
HAS_NON_BREAKING=$(echo "$LABELS" | jq 'map(select(. == "non-breaking-change")) | length')

if [ "$HAS_BREAKING" -gt 0 ] && [ "$HAS_NON_BREAKING" -gt 0 ]; then
echo "::error::PR has both 'breaking-change' and 'non-breaking-change' labels. Please remove one — a change cannot be both."
exit 1
fi

if [ "$HAS_BREAKING" -eq 0 ] && [ "$HAS_NON_BREAKING" -eq 0 ]; then
echo "::error::PR is missing a required label. Please add exactly one of: 'breaking-change' or 'non-breaking-change'."
exit 1
fi

echo "✅ Label check passed."
Loading