github-script
Covers efficient patterns and standards for utilizing the github-script library within workflow definitions.
Install
mkdir -p .claude/skills/github-script && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/7050" && unzip -o skill.zip -d .claude/skills/github-script && rm skill.zipInstalls to .claude/skills/github-script
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Write robust JavaScript for GitHub Actions github-script steps.Key capabilities
- →Log information using core.info and core.error
- →Set action outputs and environment variables
- →Write Markdown content to step summaries
- →Handle errors with core.setFailed
- →Format and lint JavaScript code
How it works
It provides best practices for using the GitHub Actions toolkit to log, output data, and generate summaries within JavaScript scripts.
Inputs & outputs
When to use github-script
- →Write GitHub Actions scripts
- →Automate repo maintenance
- →Use github-script safely
About this skill
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.
When not to use it
- →When using console.log for logging
Limitations
- →Requires adherence to specific toolkit API usage
- →Limited to scripts executed by actions/github-script
How it compares
It emphasizes using the official toolkit methods over standard console methods for better integration with GitHub Actions.
Compared to similar skills
github-script side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| github-script (this skill) | 1 | 3mo | No flags | Intermediate |
| turborepo | 61 | 2mo | Review | Intermediate |
| upgrading-expo | 3 | 4mo | Review | Intermediate |
| pnpm-upgrade | 2 | 3mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by githubnext
View all by githubnext →You might also like
turborepo
vercel
Turborepo monorepo build system guidance. Triggers on: turbo.json, task pipelines, dependsOn, caching, remote cache, the "turbo" CLI, --filter, --affected, CI optimization, environment variables, internal packages, monorepo structure/best practices, and boundaries. Use when user: configures tasks/workflows/pipelines, creates packages, sets up monorepo, shares code between apps, runs changed/affected packages, debugs cache, or has apps/packages directories.
upgrading-expo
sickn33
Upgrade Expo SDK versions
pnpm-upgrade
openai
Keep pnpm current: run pnpm self-update/corepack prepare, align packageManager in package.json, and bump pnpm/action-setup + pinned pnpm versions in .github/workflows to the latest release. Use this when refreshing the pnpm toolchain manually or in automation.
pnpm
antfu
Node.js package manager with strict dependency resolution. Use when running pnpm specific commands, configuring workspaces, or managing dependencies with catalogs, patches, or overrides.
javascript-pro
sickn33
Master modern JavaScript with ES6+, async patterns, and Node.js APIs. Handles promises, event loops, and browser/Node compatibility. Use PROACTIVELY for JavaScript optimization, async debugging, or complex JS patterns.
windsurf-linting-config
jeremylongshore
Configure and enforce code quality with AI-assisted linting. Activate when users mention "configure linting", "eslint setup", "code quality rules", "linting configuration", or "code standards". Handles linting tool configuration. Use when configuring systems or services. Trigger with phrases like "windsurf linting config", "windsurf config", "windsurf".