背景
GitHub Actions で利用している actions/github-script を v7 系から v9 系へ更新する。
現在、workflow で actions/github-script v7.0.1 が利用されている。pinact run -u --min-age 7 の結果、更新先は v9.0.0 となる。
対象
actions/github-script v7.0.1 -> v9.0.0
参考
Changelog
actions/github-script v8
What's Changed
⚠️ Minimum Compatible Runner Version
v2.327.1
Release Notes
Make sure your runner is updated to this version or newer to use this release.
New Contributors
Full Changelog: actions/github-script@v7.1.0...v8.0.0
https://github.com/actions/github-script/releases/tag/v8 より引用
actions/github-script v9.0.0
New features:
getOctokit factory function — Available directly in the script context. Create additional authenticated Octokit clients with different tokens for multi-token workflows, GitHub App tokens, and cross-org access. See Creating additional clients with getOctokit for details and examples.
- Orchestration ID in user-agent — The
ACTIONS_ORCHESTRATION_ID environment variable is automatically appended to the user-agent string for request tracing.
Breaking changes:
require('@actions/github') no longer works in scripts. The upgrade to @actions/github v9 (ESM-only) means require('@actions/github') will fail at runtime. If you previously used patterns like const { getOctokit } = require('@actions/github') to create secondary clients, use the new injected getOctokit function instead — it's available directly in the script context with no imports needed.
getOctokit is now an injected function parameter. Scripts that declare const getOctokit = ... or let getOctokit = ... will get a SyntaxError because JavaScript does not allow const/let redeclaration of function parameters. Use the injected getOctokit directly, or use var getOctokit = ... if you need to redeclare it.
- If your script accesses other
@actions/github internals beyond the standard github/octokit client, you may need to update those references for v9 compatibility.
What's Changed
New Contributors
Full Changelog: actions/github-script@v8.0.0...v9.0.0
https://github.com/actions/github-script/releases/tag/v9.0.0 より引用
主な変更点
v8.0.0 で action runtime が Node.js 24 に更新された。
- self-hosted runner を使う場合は Actions Runner
v2.327.1 以上が必要。
@actions/github v9 が ESM-only になり、script 内の require('@actions/github') は利用できなくなる。
getOctokit が script context に注入される。
- 現在の
wc-changes.yml の script では require('@actions/github') や getOctokit の再宣言は見つからない。
対応方針
actions/github-script を利用している workflow を v9.0.0 に更新する。
- 対象 script の出力
dependencies が従来通り設定されることを確認する。
完了条件
背景
GitHub Actions で利用している
actions/github-scriptを v7 系から v9 系へ更新する。現在、workflow で
actions/github-scriptv7.0.1が利用されている。pinact run -u --min-age 7の結果、更新先はv9.0.0となる。対象
actions/github-scriptv7.0.1->v9.0.0参考
Changelog
actions/github-scriptv8https://github.com/actions/github-script/releases/tag/v8 より引用
actions/github-scriptv9.0.0https://github.com/actions/github-script/releases/tag/v9.0.0 より引用
主な変更点
v8.0.0で action runtime が Node.js 24 に更新された。v2.327.1以上が必要。@actions/githubv9 が ESM-only になり、script 内のrequire('@actions/github')は利用できなくなる。getOctokitが script context に注入される。wc-changes.ymlの script ではrequire('@actions/github')やgetOctokitの再宣言は見つからない。対応方針
actions/github-scriptを利用している workflow をv9.0.0に更新する。dependenciesが従来通り設定されることを確認する。完了条件
pinactによりactions/github-scriptがv9.0.0に更新されている。pinact run --verifyが成功する。wc-changes.ymlを呼び出す check workflow が PR 上で成功する。