> **github-workflows-query** — skill 39 of 54 in [github/gh-aw](https://skillsdocs.com/github/gh-aw).
>
> Book (all skills, one file): https://skillsdocs.com/github/gh-aw.md
> Machine manifest: https://skillsdocs.com/github/gh-aw/.well-known/agent-skills/index.json
> Origin: credited — this skill is installed into this repository and in use here, not published from it, so there is no install command.
> Upstream: https://github.com/github/gh-aw/blob/main/.github/skills/github-workflows-query/SKILL.md @ `main`
> Raw bytes, no header: https://raw.githubusercontent.com/github/gh-aw/main/.github/skills/github-workflows-query/SKILL.md
> Base for relative paths: https://raw.githubusercontent.com/github/gh-aw/main/.github/skills/github-workflows-query/
> Licence: MIT — https://spdx.org/licenses/MIT.html
>
> Bundled files (1), referenced from this skill's directory:
>   - `query-workflows.sh` — https://raw.githubusercontent.com/github/gh-aw/main/.github/skills/github-workflows-query/query-workflows.sh
>
> Content © its authors, served unmodified. Takedown: https://github.com/DreambaseAI/skillsdocs/issues/new?labels=takedown&title=Takedown+request

<!-- Verbatim upstream SKILL.md follows, YAML frontmatter included. -->

---
name: github-workflows-query
description: List GitHub Actions workflows with per_page pagination support.
---

# GitHub Workflows Query Skill

List GitHub Actions workflows with efficient pagination using the `--per-page` flag.

## Usage

Use this script to list workflows from any repository with controlled page sizes.

### Basic Usage

```bash
./query-workflows.sh --owner github --repo gh-aw
# Returns 10 workflows (default per_page=10)
```

### Pagination

```bash
# Get the first workflow only
./query-workflows.sh --owner github --repo gh-aw --per-page 1

# Get 50 workflows starting from page 2
./query-workflows.sh --owner github --repo gh-aw --per-page 50 --page 2
```

## Parameters

| Parameter | Required | Default | Description |
|-----------|----------|---------|-------------|
| `--owner` | Yes | - | Repository owner (username or organization) |
| `--repo` | Yes | - | Repository name |
| `--per-page` | No | 10 | Results per page (1–100) |
| `--page` | No | 1 | Page number |

## Output

Returns JSON with the following fields:

```json
{
  "total_count": 42,
  "per_page": 10,
  "page": 1,
  "workflows": [
    {
      "id": 12345,
      "node_id": "W_...",
      "name": "CI",
      "path": ".github/workflows/ci.yml",
      "state": "active",
      "created_at": "2024-01-01T00:00:00Z",
      "updated_at": "2024-01-01T00:00:00Z",
      "url": "https://api.github.com/repos/owner/repo/actions/workflows/12345",
      "html_url": "https://github.com/owner/repo/actions/workflows/ci.yml",
      "badge_url": "https://github.com/owner/repo/actions/workflows/ci.yml/badge.svg"
    }
  ]
}
```

## Source

Calls the GitHub REST API:
`GET /repos/{owner}/{repo}/actions/workflows?per_page={n}&page={n}`
