Bumps the actions group with 6 updates: | Package | From | To | | --- | --- | --- | | [github/codeql-action](https://github.com/github/codeql-action) | `4.32.4` | `4.35.2` | | [actions/github-script](https://github.com/actions/github-script) | `8.0.0` | `9.0.0` | | [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) | `6.0.0` | `6.1.0` | | [redhat-plumbers-in-action/gather-pull-request-metadata](https://github.com/redhat-plumbers-in-action/gather-pull-request-metadata) | `1.9.0` | `1.9.1` | | [super-linter/super-linter](https://github.com/super-linter/super-linter) | `8.5.0` | `8.6.0` | | [softprops/action-gh-release](https://github.com/softprops/action-gh-release) | `2.6.1` | `3.0.0` | Updates `github/codeql-action` from 4.32.4 to 4.35.2 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/89a39a4e59826350b863aa6b6252a07ad50cf83e...95e58e9a2cdfd71adc6e0353d5c52f41a045d225) Updates `actions/github-script` from 8.0.0 to 9.0.0 - [Release notes](https://github.com/actions/github-script/releases) - [Commits](https://github.com/actions/github-script/compare/ed597411d8f924073f98dfc5c65a23a2325f34cd...3a2844b7e9c422d3c10d287c895573f7108da1b3) Updates `aws-actions/configure-aws-credentials` from 6.0.0 to 6.1.0 - [Release notes](https://github.com/aws-actions/configure-aws-credentials/releases) - [Changelog](https://github.com/aws-actions/configure-aws-credentials/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws-actions/configure-aws-credentials/compare/8df5847569e6427dd6c4fb1cf565c83acfa8afa7...ec61189d14ec14c8efccab744f656cffd0e33f37) Updates `redhat-plumbers-in-action/gather-pull-request-metadata` from 1.9.0 to 1.9.1 - [Release notes](https://github.com/redhat-plumbers-in-action/gather-pull-request-metadata/releases) - [Commits](https://github.com/redhat-plumbers-in-action/gather-pull-request-metadata/compare/b86d1eaf7038cf88a56b26ba3e504f10e07b0ce5...62fc85c7acd15db62a0bdf007c8dbeda86eaf3b6) Updates `super-linter/super-linter` from 8.5.0 to 8.6.0 - [Release notes](https://github.com/super-linter/super-linter/releases) - [Changelog](https://github.com/super-linter/super-linter/blob/main/CHANGELOG.md) - [Commits](https://github.com/super-linter/super-linter/compare/61abc07d755095a68f4987d1c2c3d1d64408f1f9...9e863354e3ff62e0727d37183162c4a88873df41) Updates `softprops/action-gh-release` from 2.6.1 to 3.0.0 - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](https://github.com/softprops/action-gh-release/compare/153bb8e04406b158c6c84fc1615b65b24149a1fe...b4309332981a82ec1c5618f44dd2e27cc8bfbfda) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.35.2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: actions/github-script dependency-version: 9.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: aws-actions/configure-aws-credentials dependency-version: 6.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: redhat-plumbers-in-action/gather-pull-request-metadata dependency-version: 1.9.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: super-linter/super-linter dependency-version: 8.6.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: softprops/action-gh-release dependency-version: 3.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com>
137 lines
5.0 KiB
YAML
137 lines
5.0 KiB
YAML
---
|
|
# vi: ts=2 sw=2 et:
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
#
|
|
name: "Pull Request Labeler"
|
|
|
|
on:
|
|
pull_request_target:
|
|
types: [opened, synchronize, reopened, ready_for_review, closed]
|
|
paths-ignore:
|
|
- '.github/labeler.yml'
|
|
- '.github/workflows/labeler.yml'
|
|
# Allow testing changes made to the labeler configuration
|
|
pull_request:
|
|
paths:
|
|
- '.github/labeler.yml'
|
|
- '.github/workflows/labeler.yml'
|
|
issue_comment:
|
|
types: [created]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
triage:
|
|
if: github.repository == 'systemd/systemd'
|
|
runs-on: ubuntu-24.04
|
|
permissions:
|
|
pull-requests: write
|
|
|
|
steps:
|
|
- name: Repository checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
if: github.event_name == 'pull_request'
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Label PR based on policy in labeler.yml
|
|
uses: actions/labeler@c5dadc2a45784a4b6adfcd20fea3465da3a5f904
|
|
if: startsWith(github.event_name, 'pull_request') && github.base_ref == 'main' && github.event.action != 'closed'
|
|
with:
|
|
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
configuration-path: .github/labeler.yml
|
|
sync-labels: false
|
|
|
|
- name: Set or remove labels based on systemd development workflow
|
|
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
|
|
if: startsWith(github.event_name, 'pull_request') && github.event.action != 'closed' && !github.event.pull_request.draft
|
|
with:
|
|
script: |
|
|
response = await github.rest.issues.listLabelsOnIssue({
|
|
issue_number: context.issue.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
});
|
|
|
|
original = new Set(response.data.map(l => l.name));
|
|
labels = new Set(original);
|
|
|
|
good_to_merge = new Set([
|
|
"good-to-merge/waiting-for-ci 👍",
|
|
"good-to-merge/after-next-release",
|
|
"good-to-merge/with-minor-suggestions",
|
|
"good-to-merge/waiting-for-reporter-feedback 👍",
|
|
]);
|
|
|
|
if (Array.from(labels).filter(l => good_to_merge.has(l)).length == 0) {
|
|
labels.add("please-review");
|
|
}
|
|
|
|
for (const label of ["reviewed/needs-rework 🔨",
|
|
"ci-fails/needs-rework 🔥",
|
|
"ci-failure-appears-unrelated",
|
|
"needs-rebase"]) {
|
|
labels.delete(label);
|
|
}
|
|
|
|
if (labels.size != original.size || Array.from(labels).some(l => !original.has(l))) {
|
|
await github.rest.issues.setLabels({
|
|
issue_number: context.issue.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
labels: Array.from(labels),
|
|
});
|
|
}
|
|
|
|
- name: Add please-review label on command in issue comment
|
|
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
|
|
if: github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/please-review')
|
|
with:
|
|
script: |
|
|
await github.rest.issues.addLabels({
|
|
issue_number: context.issue.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
labels: ["please-review"]
|
|
})
|
|
|
|
- name: Remove specific labels when PR is closed or merged
|
|
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
|
|
if: startsWith(github.event_name, 'pull_request') && github.event.action == 'closed'
|
|
with:
|
|
script: |
|
|
response = await github.rest.issues.listLabelsOnIssue({
|
|
issue_number: context.issue.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
});
|
|
|
|
original = new Set(response.data.map(l => l.name));
|
|
labels = new Set(original);
|
|
|
|
for (const label of ["please-review",
|
|
"reviewed/needs-rework 🔨",
|
|
"ci-fails/needs-rework 🔥",
|
|
"needs-rebase",
|
|
"good-to-merge/waiting-for-ci 👍",
|
|
"good-to-merge/after-next-release",
|
|
"good-to-merge/with-minor-suggestions",
|
|
"good-to-merge/waiting-for-reporter-feedback 👍",
|
|
"needs-discussion 🤔",
|
|
"needs-reporter-feedback ❓",
|
|
"dont-merge 💣",
|
|
"squash-on-merge",
|
|
"quick-review 🏃♂️"]) {
|
|
labels.delete(label);
|
|
}
|
|
|
|
if (labels.size != original.size || Array.from(labels).some(l => !original.has(l))) {
|
|
await github.rest.issues.setLabels({
|
|
issue_number: context.issue.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
labels: Array.from(labels),
|
|
});
|
|
}
|