workflows/labels: various fixes (#418504)

This commit is contained in:
Wolfgang Walther
2025-06-21 11:38:41 +00:00
committed by GitHub
3 changed files with 20 additions and 5 deletions
+18 -4
View File
@@ -72,8 +72,8 @@ jobs:
maxConcurrent: 1,
// Hourly limit is at 5000, but other jobs need some, too!
// https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api
reservoir: 1000,
reservoirRefreshAmount: 1000,
reservoir: 500,
reservoirRefreshAmount: 500,
reservoirRefreshInterval: 60 * 60 * 1000
})
// Pause between mutative requests
@@ -152,7 +152,17 @@ jobs:
status: prEventCondition ? 'in_progress' : 'success',
exclude_pull_requests: true,
head_sha: pull_request.head.sha
})).data.workflow_runs[0]?.id
})).data.workflow_runs[0]?.id ??
// TODO: Remove this after 2025-09-17, at which point all eval.yml artifacts will have expired.
(await github.rest.actions.listWorkflowRuns({
...context.repo,
// In older PRs, we need eval.yml instead of pr.yml.
workflow_id: 'eval.yml',
event: 'pull_request_target',
status: 'success',
exclude_pull_requests: true,
head_sha: pull_request.head.sha
})).data.workflow_runs[0]?.id
// Newer PRs might not have run Eval to completion, yet. We can skip them, because this
// job will be run as part of that Eval run anyway.
@@ -186,7 +196,11 @@ jobs:
// Get all currently set labels that we manage
const before =
pull_request.labels.map(({ name }) => name)
(await github.paginate(github.rest.issues.listLabelsOnIssue, {
...context.repo,
issue_number: pull_request.number
}))
.map(({ name }) => name)
.filter(name =>
name.startsWith('10.rebuild') ||
name == '11.by: package-maintainer' ||
+1
View File
@@ -8,6 +8,7 @@ on:
- .github/workflows/eval.yml
- .github/workflows/lint.yml
- .github/workflows/pr.yml
- .github/workflows/labels.yml
- .github/workflows/reviewers.yml # needs eval results from the same event type
pull_request_target:
+1 -1
View File
@@ -100,7 +100,7 @@ let
(getLabels rebuildCountByKernel)
# Adds "10.rebuild-*-stdenv" label if the "stdenv" attribute was changed
++ lib.mapAttrsToList (kernel: _: "10.rebuild-${kernel}-stdenv") (
lib.filterAttrs (_: kernelRebuilds: kernelRebuilds ? "stdenv") rebuildsByKernel
lib.filterAttrs (_: lib.elem "stdenv") rebuildsByKernel
)
# Adds the "11.by: package-maintainer" label if all of the packages directly
# changed are maintained by the PR's author. (https://github.com/NixOS/ofborg/blob/df400f44502d4a4a80fa283d33f2e55a4e43ee90/ofborg/src/tagger.rs#L83-L88)