github-script

Enforce github-script@v8 best practices for GitHub Actions workflows.

4.9k|489|Updated Aug 12, 2025
One-click install
npx skills add https://github.com/github/gh-aw --skill github-script-github
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: github-script
Source: https://github.com/github/gh-aw/tree/main/skills/github-script
Command: npx skills add https://github.com/github/gh-aw --skill github-script-github

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides best practices for writing JavaScript code for GitHub Actions using github-script@v8, helping teams implement reliable automation without boilerplate.

Core Features & Use Cases

  • Guidelines for using github-script@v8 with clarity on logging, outputs, inputs, and error handling.
  • Best practices for reliability: avoid console.log, use core.info/core.warning/core.error, and proper output and environment variable management.
  • Use Case: When automating repository tasks with GitHub Actions, follow these practices to ensure consistent, auditable automation.

Quick Start

Use the github-script best practices guide to structure a minimal action and apply recommended core helpers.

Frequently Asked Questions about github-script

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write reliable JavaScript for GitHub Actions?

Reliable JavaScript for GitHub Actions requires using github-script@v8 with @actions/core and @actions/github to handle logging, outputs, and repository interactions consistently. This enforces standardized input retrieval and output setting for auditable CI workflows.

Why should I use core.info instead of console.log in GitHub Actions?

You should use core.info, core.warning, and core.error instead of console.log in GitHub Actions because the @actions/core toolkit provides standardized output and environment variable management. Avoiding console usage ensures consistent, reliable logging and proper error handling within your CI workflows.

What is the best way to set outputs and handle errors in github-script?

The best way to set outputs and handle errors in github-script is by applying @actions/core helpers for standardized output setting and error management. Following these prescribed best practices ensures your CI automation avoids boilerplate and remains auditable.

Do I need @actions/github to interact with repositories in github-script?

Yes, you need @actions/github to interact with repositories in github-script. The skill enforces using @actions/github alongside @actions/core to standardize repository interactions, logging, and input retrieval in your GitHub Actions CI workflows.

Can I add step summaries to my GitHub Actions using github-script?

Yes, you can add optional step summaries to your GitHub Actions using github-script. The skill prescribes including step summaries alongside standardized input retrieval, output setting, and error handling to maintain reliable and auditable automation.