github-workflows-query

Lists GitHub Actions workflows via the REST API with per-page pagination control.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Retrieving the list of GitHub Actions workflows for a repository requires calling the GitHub REST API with correct pagination parameters and parsing the raw JSON response. This Skill wraps that call in a single script that validates inputs, applies per-page and page controls, and returns a clean, filtered JSON result.

Core Features & Use Cases

  • Paginated Workflow Listing: Query the GitHub Actions workflows endpoint with configurable per-page (1-100) and page number parameters.
  • Flexible Input Methods: Pass parameters as CLI flags or through INPUT_* environment variables following the mcp-scripts convention.
  • Structured JSON Output: Returns total_count, pagination metadata, and a filtered workflow array containing id, name, path, state, timestamps, and URLs.
  • Use Case: An automation agent auditing a repository's CI setup can call this script to enumerate all active workflows page by page, then inspect each workflow file for further analysis.

Quick Start

List the GitHub Actions workflows in the github/gh-aw repository with 10 results per page.

Frequently Asked Questions about github-workflows-query

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

FAQPage Schema
How do I list GitHub Actions workflows for a repository?

Run the query-workflows.sh script with --owner and --repo flags to call the GitHub REST API actions/workflows endpoint. It returns JSON containing total_count and an array of workflows with id, name, path, state, and URLs.

How to paginate GitHub API workflow results?

Use the --per-page flag (1 to 100, default 10) together with --page to control pagination. For example, --per-page 50 --page 2 returns the second page of 50 workflows from the API.

Can I pass parameters as environment variables instead of CLI flags?

Yes, the script accepts INPUT_OWNER, INPUT_REPO, INPUT_PERPAGE, and INPUT_PAGE environment variables following the mcp-scripts convention. CLI flags take precedence over environment variables when both are provided.

What tools are required to run the workflow query script?

The script requires the GitHub CLI (gh) for authenticated API calls and jq for JSON filtering. Both must be installed and gh must be authenticated to access the target repository.

Why does the script reject my per-page value?

The script validates that per-page is a number between 1 and 100, matching the GitHub API limit. Values outside this range or non-numeric input produce an error and exit with status 1.