Skip to content
Merged
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
28 changes: 28 additions & 0 deletions .github/workflows/breaking_changes_detector_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ on:
permissions:
contents: read

# A dedicated label, separate from the existing `api change` label.
# `api change` may be applied manually for behavioral changes that aren't
# strictly API changes, so we can't safely auto-remove it when this check
# passes. This auto-managed label is fully owned by the workflow.
env:
BREAKING_CHANGE_LABEL: "auto detected api change"

jobs:
comment-on-pr:
name: Comment on pull request
Expand Down Expand Up @@ -130,3 +137,24 @@ jobs:
number: ${{ steps.read.outputs.pr_number }}
body-include: '<!-- semver-check-comment -->'
delete: true

- name: Add "auto detected api change" label
if: steps.read.outputs.result != 'success'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
PR_NUMBER: ${{ steps.read.outputs.pr_number }}
run: |
gh pr edit "$PR_NUMBER" --repo "$REPO" \
--add-label "$BREAKING_CHANGE_LABEL"

- name: Remove "auto detected api change" label
if: steps.read.outputs.result == 'success'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
PR_NUMBER: ${{ steps.read.outputs.pr_number }}
run: |
# No-op when the label isn't currently applied.
gh pr edit "$PR_NUMBER" --repo "$REPO" \
--remove-label "$BREAKING_CHANGE_LABEL" || true
2 changes: 1 addition & 1 deletion dev/release/generate-changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def generate_changelog(repo, repo_name, tag1, tag2, version):
cc_breaking = parts_tuple[2] == '!'

labels = [label.name for label in pull.labels]
if 'api change' in labels or cc_breaking:
if 'api change' in labels or 'auto detected api change' in labels or cc_breaking:
breaking.append((pull, commit))
elif 'bug' in labels or cc_type == 'fix':
bugs.append((pull, commit))
Expand Down
Loading