NetFabric/NetFabric.Numerics / .agents/skills/copilot-github-actions
copilot-github-actions
VerifiedAutomate GitHub Copilot CLI in GitHub Actions workflows. USE FOR: installing/running `copilot -p` in workflow steps, choosing GITHUB_TOKEN vs a personal access token (COPILOT_GITHUB_TOKEN) for authentication, setting the copilot-requests write permission, minimal-permission tool allowlisting (--allow-tool, --deny-tool, --no-ask-user, -s/--silent, --output-format=json), triggers (schedule, workflow_dispatch, push), the recommended GitHub Agentic Workflows (gh-aw) alternative to direct CLI invocation, and security/cost considerations (fork PR prompt-injection risk, billing attribution, cost centers). DO NOT USE FOR: embedding the Copilot agent runtime into your own application (use copilot-sdk instead); general GitHub Actions authoring unrelated to Copilot; the Copilot code review or PR features outside of CLI automation.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 3.8 KB |
| references/authentication.md | markdown | 2.8 KB |
| references/cli-invocation-patterns.md | markdown | 3.2 KB |
| references/gh-aw-vs-direct.md | markdown | 2.7 KB |
| references/security-and-cost.md | markdown | 2.3 KB |
references/gh-aw-vs-direct.md
View on GitHub# GitHub Agentic Workflows vs. Direct CLI Invocation
## Recommendation
GitHub's own docs recommend [GitHub Agentic Workflows](https://github.com/github/gh-aw) (`gh-aw`) over invoking `copilot` directly in a workflow `run:` step for most automation. Agentic Workflows use `GITHUB_TOKEN` by default and add guardrails designed for unattended/automated contexts that raw CLI steps don't have.
| | Direct CLI in `run:` | GitHub Agentic Workflows (`gh-aw`) |
|---|---|---|
| Setup | Install CLI + write prompt inline in YAML | `gh aw add-wizard <owner>/<repo>/<workflow>`, or author Markdown workflows |
| Source format | Raw `run: copilot -p "..."` steps | Markdown workflow (`.md`) + generated, committed `.lock.yml` compiled by `gh aw compile` |
| Guardrails | You configure `--allow-tool`, permissions, etc. yourself | Built-in guardrails/safe-outputs suited for automated environments |
| Engines | Copilot CLI only | Copilot, Claude Code, OpenAI Codex, or Google Gemini — selectable |
| Best for | Simple one-off steps, full control over exact CLI flags | Recurring automations, org-wide rollout, less manual security review per workflow |
## When direct invocation is fine
Simple, low-risk automation you fully control — e.g. a scheduled summary job with tightly scoped `--allow-tool` flags and no untrusted-input triggers (see [security-and-cost.md](security-and-cost.md)). See [cli-invocation-patterns.md](cli-invocation-patterns.md) for the exact syntax.
## Adopting `gh-aw`
1. Install the extension: `gh extension install github/gh-aw` (or the install script if auth fails), then `gh auth login --scopes repo,workflow`.
2. Add a workflow: `gh aw add-wizard <owner>/<repo>/<workflow-name>` (interactive) or `gh aw add` (non-interactive). Example: `gh aw add-wizard githubnext/agentics/daily-repo-status --engine copilot`.
3. Set up auth: for the Copilot engine, create a fine-grained PAT with **Copilot Requests: Read**, then `gh secret set COPILOT_GITHUB_TOKEN < token.txt`. This is separate from `GITHUB_TOKEN` because the agent needs elevated Copilot API access an ephemeral workflow token doesn't carry.
4. The wizard commits both the `.md` source and the generated `.lock.yml` (the compiled workflow GitHub Actions actually runs) to `.github/workflows/` — don't hand-edit the lock file; re-run `gh aw compile` after changing frontmatter.
5. Your workflow needs the `copilot-requests: write` permission in addition to whatever `gh-aw` frontmatter you configure.
## Further reading
`gh-aw` covers many more patterns than this skill duplicates: issue triage, PR review, release notes, docs automation, cross-repo orchestration, safe outputs, and sandboxing. See the [gh-aw reference docs](https://github.github.com/gh-aw/) when a task needs more than a single scheduled `copilot -p` step.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |