Skip to content
Closed
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
19 changes: 11 additions & 8 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,19 @@ jobs:
backport:
runs-on: ubuntu-latest
name: Backport label added
if: ${{ github.event.pull_request.user.type != 'Bot' }}
if: >-
${{
github.event.pull_request.user.type != 'Bot' &&
contains(join(github.event.pull_request.labels.*.name, ','), 'backport-')
}}
steps:
- uses: actions/github-script@v8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number
});
if (!pr.data.labels.find(l => l.name.startsWith("backport")))
process.exit(1);
const hasBackportLabel = context.payload.pull_request.labels.some(
label => label.name.startsWith("backport"),
);
if (!hasBackportLabel) {
core.notice("No backport label present, skipping.");
}
1 change: 1 addition & 0 deletions CHANGES/12169.contrib.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adjusted the GitHub Actions backport-label check so ordinary pull requests without ``backport-*`` labels are skipped instead of reported as failed -- by :user:`1ort`.
Loading