Skip to content

ci: replace blocked issues-helper action and fix release event race#9549

Open
okatu-loli wants to merge 1 commit into
mainfrom
fix/issues-helper-blocked-and-release-race
Open

ci: replace blocked issues-helper action and fix release event race#9549
okatu-loli wants to merge 1 commit into
mainfrom
fix/issues-helper-blocked-and-release-race

Conversation

@okatu-loli

Copy link
Copy Markdown
Collaborator

背景 / Why

仓库里多个 GitHub Actions 报错,定位到两类根因:

1. Issue 自动化 —— 依赖的 action 被 GitHub 封禁

所有 issue 相关 workflow 都依赖 actions-cool/issues-helper。该仓库已于 2026-05-19 因违反服务条款(ToS)被 GitHub 封禁:

{"message":"Repository access blocked","block":{"reason":"tos","created_at":"2026-05-19T00:33:29Z"}}

因此这些 workflow 一律在 Getting action download info 阶段失败:##[error]Repository access blocked。受影响 7 个文件。

2. Release 系列 —— 重复发布同一 tag 导致 404 竞态

v3.61.0 发版时观察到:失败的 release.yml 引用 release id 332851420,而成功的 freebsd job 引用 332851481 —— 同一 tag 被发布了两次,旧 release 被删/重建。旧那批 job 仍指向已删除的 release id,于是:

  • release.ymlirongut/EditRelease 步骤 → Octokit.NotFoundException - Not Found
  • release_freebsd.ymlsoftprops/action-gh-releaseNot Found - update-a-release-asset

改动 / What

Issue workflows —— 全部改用官方 actions/github-script@v7 内联实现,去掉被封依赖:

文件 行为
issue_on_close.yml 移除 working/pr-welcome 标签(忽略 404)
issue_duplicate.yml / issue_invalid.yml / issue_wontfix.yml 评论 + 关闭
issue_question.yml 仅评论
issue_close_stale.yml / issue_close_question.yml 分页拉取带标签的 open issue,关闭超过不活跃阈值的
  • 定时任务里的评论现在 @ 真实 issue 作者(旧代码在 schedule 上下文里 github.event.issue 为 undefined,会变成空的 @)。
  • 每个 workflow 都加了最小权限 permissions: issues: write

Release workflows —— 5 个文件加按 tag 命名的并发组,重新发布同一 tag 时取消引用旧 release id 的过期运行:

concurrency:
  group: ${{ github.workflow }}-${{ github.event.release.tag_name }}
  cancel-in-progress: true

不同平台 github.workflow 不同,仍各自并行,不影响发版完整性。

说明 / Note

Note

若在单次干净发布EditRelease 仍报 404,则需另查 MY_TOKEN secret 是否过期/权限不足 —— 那是密钥轮换问题,无法在代码层修复。本 PR 处理的是观测到的重复发布竞态。

YAML 已全部本地校验通过。

The `actions-cool/issues-helper` repository was blocked by GitHub for a
ToS violation on 2026-05-19, so every issue-automation workflow that
depends on it now fails at "Getting action download info" with
"Repository access blocked".

Replace all usages with inline `actions/github-script@v7`:
- issue_on_close.yml: remove `working`/`pr-welcome` labels (ignore 404)
- issue_duplicate.yml / issue_invalid.yml / issue_wontfix.yml: comment + close
- issue_question.yml: comment only
- issue_close_stale.yml / issue_close_question.yml: paginate open issues
  by label, close those inactive past the cutoff. Comments now address the
  actual per-issue author instead of an empty `@` (the old `github.event.issue`
  expression was undefined in the scheduled context).

Each workflow now declares a least-privilege `permissions: issues: write`.

Also guard the release workflows against the duplicate-publish race: when
the same tag is re-published the release is recreated with a new id, leaving
in-flight runs pointing at a deleted release id and failing with 404 (seen in
release.yml EditRelease and release_freebsd.yml asset upload). Add a per-tag
concurrency group with cancel-in-progress so only the newest publish proceeds.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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