Try remove label

This commit is contained in:
Jesse Hills 2024-03-27 22:41:10 +13:00
parent b9510003f0
commit be843f9ee3
No known key found for this signature in database
GPG Key ID: BEAAE804EFD8E83A
1 changed files with 19 additions and 0 deletions

View File

@ -22,6 +22,25 @@ jobs:
labels: ['wrong-base-branch']
});
- name: Remove wrong-base-branch label
id: remove-wrong-base-branch-label
uses: actions/github-script@v7.0.1
if: |
contains(github.event.pull_request.labels.*.name, 'wrong-base-branch') &&
(
(contains(github.event.pull_request.labels.*.name, 'current') && !contains(github.event.pull_request.labels.*.name, 'has-parent'))
||
(contains(github.event.pull_request.labels.*.name, 'next') && contains(github.event.pull_request.labels.*.name, 'has-parent'))
)
with:
script: |
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: 'wrong-base-branch'
});
- name: Has wrong-base-branch label
if: contains(github.event.pull_request.labels.*.name, 'wrong-base-branch') || steps.add-wrong-base-branch-label.outcome == 'success'
uses: actions/github-script@v7.0.1