Skip to content

fix(labeler): runner input, label creation, and stale-breaking removal - #18

Merged
sotashimozono merged 1 commit into
mainfrom
fix/labeler-rest-runner-input
Jul 28, 2026
Merged

fix(labeler): runner input, label creation, and stale-breaking removal#18
sotashimozono merged 1 commit into
mainfrom
fix/labeler-rest-runner-input

Conversation

@sotashimozono

Copy link
Copy Markdown
Member

Why now

gh pr edit --add-label reads the pull request over GraphQL, and GitHub now answers that
query with the Projects-classic sunset notice (repository.pullRequest.projectCards). gh
reports it as an error and exits 1, so the hand-rolled per-repo PRLabeler.yml fails on a
deprecation message that has nothing to do with labelling. Measured on
lab-sotashimozono/FunctionMeasures.jl: green on PR #48 (07-27), red on PR #49 (07-28).

A sweep of the three owners found 40 repos still carrying that hand-rolled version
(19 lab-sotashimozono, 4 QAtlasHub, 17 sotashimozono) against 4 already calling this
reusable workflow. This PR makes the reusable one a drop-in replacement for all of them, so the
migration removes the last copies instead of forking a second implementation.

Changes

  • runner input (JSON runs-on, default "ubuntu-latest"). Private repos pass
    '["self-hosted","rosina"]' and keep the public→ubuntu / private→rosina convention instead
    of spending hosted minutes. Same idiom as lab-sotashimozono/.github's format-check.yml.
    Existing callers pass nothing and are unaffected.
  • Create a missing label before adding it, in the colours the per-repo version set with
    gh label create --force (enhancement a2eeef, bug d73a4a, performance e4e669,
    documentation 0075ca, chore e8e8e8, breaking b60205), so release-notes categories look
    the same after the migration. 422 (already exists) is swallowed.
  • Remove breaking when its box is unticked. It is the one label that must come off — it
    forces a minor bump in release-drafter's version resolver, so a stale one silently
    mis-versions the next release. The per-repo labeler did this; the others stay additive so
    the workflow never fights a hand-applied label. 404 (not present) is swallowed.
  • issues: write added — addLabels / createLabel are issue-scoped even on a PR.
  • README: the caller snippet now shows the permissions block and the private-runner form,
    with a note not to hand-roll it with gh pr edit.

After merge

Tag v1.0.3 and move v1, then convert the 40 repos to the documented caller.

…eaking`

Three changes so this reusable workflow can replace the hand-rolled per-repo
`PRLabeler.yml` that GitHub broke on 2026-07-28 (`gh pr edit` reads the PR over
GraphQL and now exits 1 on the Projects-classic sunset notice — 40 repos across
lab-sotashimozono / QAtlasHub / sotashimozono went red on a deprecation message
unrelated to labelling).

  * `runner` input (JSON `runs-on`, default `"ubuntu-latest"`) so PRIVATE repos can
    keep the self-hosted rosina convention instead of spending hosted minutes. Same
    idiom as lab-sotashimozono/.github's format-check.yml. Existing callers pass
    nothing and are unaffected.
  * create a missing label before adding it, in the colours the per-repo version
    used (`gh label create --force` there), so the release-notes categories look the
    same after the migration.
  * remove `breaking` when its box is unticked. It is the one label that must come
    off: it forces a minor bump in release-drafter's version resolver, so a stale one
    silently mis-versions the next release. The others stay additive so the workflow
    does not fight hand-applied labels.

Needs `issues: write` — addLabels/createLabel are issue-scoped even on a PR.
@sotashimozono
sotashimozono merged commit 5373c35 into main Jul 28, 2026
1 check passed
@sotashimozono
sotashimozono deleted the fix/labeler-rest-runner-input branch July 28, 2026 01:28
This was referenced Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant