github-script
Write robust JavaScript for GitHub Actions github-script steps.
- License 许可
- MIT
- 所属仓库
- github/gh-aw
- 最近更新
- 2026-11-15
- Stars
- ★ 5.6k
- Forks
- 626
01 前言 Front Matter
- name
- github-script
- description
- Write robust JavaScript for GitHub Actions github-script steps.
02 资源文件 4
- 参考文档references/divergent-reviewer.md3.6 KB
- 参考文档references/judgment-reviewer.md3.0 KB
- 参考文档references/synthesizer.md4.0 KB
- 参考文档references/tooling-reviewer.md4.3 KB
03 SKILL.md 正文
GitHub Action Script Best Practices
Use these guidelines for JavaScript executed by actions/github-script@v8.
Important Notes
- This action provides
@actions/coreand@actions/githubpackages globally - Do not add import or require for
@actions/core - Reference documentation:
Best Practices
- Use
core.info,core.warning,core.errorfor logging, notconsole.logorconsole.error - Use
core.setOutputto set action outputs - Use
core.exportVariableto set environment variables for subsequent steps - Use
core.getInputto get action inputs, withrequired: truefor mandatory inputs - Use
core.setFailedto mark the action as failed with an error message
Step Summary
Use core.summary.* function to write output the step summary file.
- Use
core.summary.addRaw()to add raw Markdown content (GitHub Flavored Markdown supported) - Make sure to call
core.summary.write()to flush pending writes - Summary function calls can be chained, e.g.
core.summary.addRaw(...).addRaw(...).write()
Common Errors
- Avoid
anytype as much as possible, use specific types orunknowninstead - Catch handler: check if error is an instance of Error before accessing message property
catch (error) {
core.setFailed(error instanceof Error ? error : String(error));
}
core.setFailedalso callscore.error, so do not call both
Typechecking
Run make js to run the typescript compiler.
Run make lint-cjs to lint the files.
Run make fmt-cjs after editing to format the file.
04 同仓库更多 Skills
cracktro
Edit, preview, and verify the standalone interactive talk deck in docs/public/cracktro (slides, SVG diagrams, transitions, WebAudio sound).
create-connector
Create or extend a declaration-only third-party connector, with narrow reads, separate safe outputs, optional protected triggers, and offline conformance evidence.
GitHub Agentic Workflows
GitHub Agentic Workflows (`gh-aw`) is a GitHub CLI extension for writing Agentic Workflows in markdown and compiling them to GitHub Actions.
windows-compatibility
Cross-platform path handling and command patterns
versioning-policy
Semver versioning rules for Squad SDK and CLI — prevents prerelease version incidents
tiered-memory
Three-tier agent memory model (hot/cold/wiki) for context reduction per spawn