github-script
Installation
SKILL.md
github-script
Use for authoring or reviewing uses: actions/github-script@v9 workflow steps.
with.script runs as an async function body; use await import(...) for module imports.
Defaults
- Pin
actions/github-script@v9 - Runtime is Node 24
- Self-hosted runner minimum is
v2.327.1 - Prefer
github.rest.*endpoint methods; usegithub.request(...)for raw requests. - For multi-token / cross-org / GitHub App scenarios,
build extra clients with the injected
getOctokit(token, opts?)factory; do not redeclare it withconst/let. - Prefer ESM modules (
.mjsor.jswith// @ts-check); avoid CommonJS (require,module.exports).require('@actions/github')no longer works in v9 —@actions/githubv9 is ESM-only. - If authoring helpers in TypeScript, compile to
.mjs/.jsand import the built file in workflow steps.