mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-11-20 17:11:35 -08:00
34 lines
1.0 KiB
YAML
34 lines
1.0 KiB
YAML
name: "Auto-label backport Pull Requests"
|
|
|
|
on:
|
|
pull_request:
|
|
types: [closed]
|
|
|
|
permissions:
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
label:
|
|
if: github.event.pull_request.merged == true
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Add backport-pending label
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
const pr = context.payload.pull_request;
|
|
|
|
// Match patch releases, e.g. v2.8.1, but not v2.8.0.
|
|
const milestone = pr.milestone?.title ?? "";
|
|
const isPatchRelease = /^v\d+\.\d+\.[1-9]\d*$/.test(milestone);
|
|
|
|
const labels = pr.labels.map(l => l.name);
|
|
if (isPatchRelease && !labels.includes("pr: backported") && !labels.includes("pr: backport-queue")) {
|
|
await github.rest.issues.addLabels({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: pr.number,
|
|
labels: ["pr: backport-pending"]
|
|
});
|
|
}
|