Skip to content

stop closing issues from the release workflow; GitHub already does it - #341

Merged
dave-doty merged 1 commit into
devfrom
no-redundant-issue-closing
Aug 1, 2026
Merged

stop closing issues from the release workflow; GitHub already does it#341
dave-doty merged 1 commit into
devfrom
no-redundant-issue-closing

Conversation

@dave-doty

Copy link
Copy Markdown
Member

Fixes the failure in the v0.21.1 release run, and removes work the release
workflow no longer needs to do.

Why the closing was redundant

With main as the default branch, GitHub acts on fixes #123 itself when the
release merges those commits into main — seconds before this job runs. Closing
them again here achieved nothing.

Why it actually broke

The job tried to comment on #123, which is a pull request. Commenting on a PR
requires pull-requests: write, which this job deliberately does not have:

GraphQL: Resource not accessible by integration (addComment)

#123 was in scope only because a commit message mentioned "fixes #123" as an
example of the syntax, not as a real reference. The keyword regex cannot tell
the difference — a known limitation, which here escalated from harmless to a red
X on a release.

What the job does now

Renamed close-issuesannotate-issues, doing only what GitHub does not:

  • comments which release shipped the fix, with links to the release and PyPI
    (skipped if already noted, so re-runs don't duplicate);
  • removes the closed in dev label applied by label-fixed-in-dev.yml.

Numbers that are pull requests, or that don't exist, are now skipped
explicitly via the issues API's .pull_request field, rather than by hoping a
gh command happens to fail — which is what went wrong, since gh issue view
succeeds on a PR number.

Adding the closed in dev label on pushes to dev is unchanged.

Validation

actionlint + shellcheck clean. The new skip logic was dry-run against the
live API for all three cases: #123 (a PR) → skipped; #317 (a real issue) →
proceeds; #999999 (nonexistent) → skipped.

Now that main is the default branch again, GitHub acts on "fixes #123" itself
when the release merges those commits into main, seconds before this job runs.
Closing them here was redundant.

It also broke the v0.21.1 release. The job tried to comment on #123, which is a
pull request, not an issue; commenting on a PR needs pull-requests: write, which
this job deliberately does not have, so it failed with "Resource not accessible
by integration (addComment)". #123 was in scope only because a commit message
mentioned "fixes #123" as an example of the syntax rather than as a real
reference -- the keyword regex cannot tell the difference.

The job is renamed to annotate-issues and now does only what GitHub does not:
records which release shipped the fix, and removes the "closed in dev" label
that label-fixed-in-dev.yml applied while the fix was unreleased. Numbers that
turn out to be pull requests, or not to exist, are skipped explicitly via the
issues API's .pull_request field rather than by hoping a gh command fails.

Adding the "closed in dev" label on pushes to dev is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@dave-doty
dave-doty merged commit 792d137 into dev Aug 1, 2026
8 checks passed
@dave-doty
dave-doty deleted the no-redundant-issue-closing branch August 1, 2026 18:28
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