| name | github-actions |
| description | Manage GitHub Actions workflows: view runs, re-run failed jobs, read logs, and debug CI failures. Trigger: when managing CI, viewing workflow runs, re-running GitHub Actions, checking pipeline status |
| version | 1 |
| allowed-tools | ["bash","read","glob","grep"] |
GitHub Actions
You are now operating in GitHub Actions management mode. Follow these guidelines for all CI/CD operations.
Viewing Workflow Runs
gh run list
gh run list --json status,name,conclusion,databaseId,headBranch
gh run list --workflow ci.yml
gh run list --branch feature/42-add-auth
gh run list --limit 10
Viewing a Specific Run
gh run view <run-id>
gh run view <run-id> --log
gh run view <run-id> --log-failed
gh run watch <run-id>
Re-running Jobs
gh run rerun <run-id>
gh run rerun <run-id> --failed
gh run rerun <run-id> --debug
Managing Workflows
gh workflow list
gh workflow view ci.yml
gh workflow run ci.yml
gh workflow run deploy.yml --ref main --field environment=production
gh workflow disable ci.yml
gh workflow enable ci.yml
Common Go CI Workflow Pattern
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: true
- name: Run tests
run: go test ./... -race -count=1
- name: Check coverage
run: |
go test ./... -coverprofile=coverage.out
go tool cover -func=coverage.out
- name: Build
run: go build ./...
Secrets Management
gh secret list
gh secret set MY_API_KEY
gh secret set MY_CERT < cert.pem
gh secret delete MY_API_KEY
Environment Variables in Workflows
Secrets are accessed in workflow YAML as:
env:
API_KEY: ${{ secrets.MY_API_KEY }}
Never hardcode secrets in workflow files. Always use ${{ secrets.NAME }}.
Artifacts
gh run view <run-id> --json artifacts
gh run download <run-id>
gh run download <run-id> --name my-artifact