Skip to content

Commit bc9a5d8

Browse files
authored
fix: remove breaking-change tag after semver passes (delta-io#1621)
## What changes are proposed in this pull request? In the past, we automatically run `cargo-semver-checks` to add `breaking-change` tag for PRs. However, the label never been removed after the semver passes. This leads to some PRs incorrectly marked as breaking.(e.g. This PR is marked as breaking since I didnt rebase to main and lack of some pub APIs in main. The tag will not be removed after I rebase). <!-- **Uncomment** this section if there are any changes affecting public APIs. Else, **delete** this section. ### This PR affects the following public APIs If there are breaking changes, please ensure the `breaking-changes` label gets added by CI, and describe why the changes are needed. Note that _new_ public APIs are not considered breaking. --> ## How was this change tested? Tested in my fork repo. For the `no-breaking` PR dengsh12#3, label was not added. For the `breaking` PR dengsh12#2, at first it is breaking, after that I restored the breaked API. We can see the robot add the `breaking-change` label first, and then removed it.
1 parent 83bb25a commit bc9a5d8

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/semver-checks.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
echo "check_status=success" >> $GITHUB_OUTPUT
5454
outputs:
5555
check_status: ${{ steps.set_failure.outputs.check_status || steps.set_success.outputs.check_status }}
56-
add_label_if_needed:
56+
update_label_if_needed:
5757
needs: check_if_pr_breaks_semver
5858
runs-on: ubuntu-latest
5959
permissions:
@@ -66,6 +66,11 @@ jobs:
6666
uses: actions-ecosystem/action-add-labels@v1
6767
with:
6868
labels: breaking-change
69+
- name: Remove breaking-change label
70+
if: needs.check_if_pr_breaks_semver.outputs.check_status == 'success' && contains(github.event.pull_request.labels.*.name, 'breaking-change')
71+
uses: actions-ecosystem/action-remove-labels@v1
72+
with:
73+
labels: breaking-change
6974
- name: On Success
7075
if: needs.check_if_pr_breaks_semver.outputs.check_status == 'success'
7176
run: |

0 commit comments

Comments
 (0)