Przejdź do treści
Biblioteka skilli
DevOps i chmura · Budowanie i kod

actions-authoring

/actions-authoring

Pomaga pisać, utwardzać i optymalizować workflow GitHub Actions: uprawnienia, przypinanie akcji, cache, matrix, concurrency i koszty.

Repozytorium
claude ↗
Licencja
MIT
Ostatnia zmiana repozytorium
22.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 22.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Pomaga pisać, utwardzać i optymalizować workflow GitHub Actions: uprawnienia, przypinanie akcji, cache, matrix, concurrency i koszty.

Oryginalny opis (EN)

This skill should be used when writing, hardening, or optimizing GitHub Actions workflows — permissions, action pinning, script injection, caching, matrices, concurrency, and cost.

Jak działa

  1. Security first — the three that actually get exploited
  2. Permissions
  3. Caching
  4. Concurrency
  5. Matrices
  6. Cost levers, ordered by typical payoff
  7. See also
Sekcje z nagłówków SKILL.md, w oryginale · 123 linii, 492 słów
Podgląd SKILL.md
---
name: actions-authoring
description: This skill should be used when writing, hardening, or optimizing GitHub Actions workflows — permissions, action pinning, script injection, caching, matrices, concurrency, and cost.
version: 1.0.0
trigger_phrases: [github actions, workflow yaml, actions permissions, cache key, matrix build, pull_request_target, CI cost]
categories: [ci, github-actions, security, performance]
author: github-orchestrator
created: 2026-08-11
updated: 2026-08-11
---

# Actions Authoring

## Security first — the three that actually get exploited

### 1. `pull_request_target` with a PR-head checkout

```yaml
# CRITICAL — a fork PR gets write-scoped secrets
on: pull_request_target
jobs:
  test:
    steps:
      - uses: actions/checkout@v4
        with: { ref: ${{ github.event.pull_request.head.sha }} }
      - run: npm test        # attacker's code, your secrets
```

`pull_request_target` runs in the **base** repo's context with secrets. Checking
out the PR head executes attacker-controlled code with those secrets in scope.
Use `pull_request` and accept that secrets are unavailable — that is the point.

### 2. Script injection through `${{ }}`

```yaml
# wrong — issue title is attacker-controlled, interpolated into the shell
- run: echo "Title: ${{ github.event.issue.title }}"

# right — passed as an environment variable
- env:
    TITLE: ${{ github.event.issue.title }}
  run: echo "Title: $TITLE"
```

Any `github.event.*` field a user can write is untrusted: title, body, branch
name, commit message, label name.

### 3. Unpinned third-party actions

Tags are mutable. Pin to a commit SHA with the version in a trailing comment:

```yaml
- uses: some-org/some-action@8f4b7c2e9a1d... # v3.1.0
```

First-party `actions/*` at a major tag is the common accepted exception — decide
deliberately rather than by default.

## Permissions

Declare explicitly. The default `GITHUB_TOKEN` scope is far wider than any
single workflow needs.

```yaml
permissions:
  contents: read          # workflow-level floor

jobs:
  release:
    permissions:
      contents: write     # narrowed per job
      id-token: write     # OIDC
```

Use OIDC for cloud auth. Long-lived cloud keys in secrets are a standing
liability that no rotation policy fully fixes.

## Caching

```yaml
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
  ${{ runner.os }}-pnpm-
```

Two failure modes, both common:

- A key containing `github.run_id`, a timestamp, or the commit sha **can never
  hit** — it costs upload time every run and saves nothing.
- A key with **no lockfile hash** never misses when it should, restoring a stale
  dependency tree after an upgrade.

Check the actual hit rate in the restore step's log before tuning anything.

## Concurrency

```yaml
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
```

Never cancel in progress on the default branch — that kills the run that gates
deploys.

## Matrices

Full OS × version matrix on every PR is usually waste. Run a representative
slice on PRs and the full matrix on the default branch and on a schedule.

```yaml
strategy:
  fail-fast: false        # you want all failures, not the first
  matrix:
    node: [20, 22]
    include:
      - { node: 24, os: ubuntu-latest, experimental: true }
```

## Cost levers, ordered by typical payoff

Cache hit rate → job graph (unnecessary `needs:`) → matrix pruning →
concurrency groups → path filters → fail-fast ordering (cheap checks first) →
runner sizing → artifact retention.

Never buy speed by dropping coverage. A removed matrix entry that covers a
supported platform is not an optimization.

## See also

- `ci-forensics` — diagnosing failures
- `../commands/audit.md` — repo-wide workflow security audit

Wersje

W bazie nie ma innych skilli o nazwie actions-authoring.

Migawka bazy z 13.11.2026 · wersja paczki 785e63c91c8c (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 1 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100review-ci
    Przegląda konfigurację CI/CD: GitHub Actions, workflow, uprawnienia, przypinanie akcji i bezpieczeństwo łańcucha dostaw.
  • 96ci-maintenance
    Pomaga przeglądać i pisać workflow GitHub Actions oraz composite actions, zwracając uwagę na uprawnienia i współbieżność.
  • 100github-actions
    Tworzy i audytuje workflow GitHub Actions pod kątem przypinania akcji do SHA oraz minimalnych uprawnień.
  • 95authoring-ci-workflows
    Pomaga dodawać i edytować workflow GitHub Actions, akcje kompozytowe i reużywalne workflow według konwencji PostHog: triggery, macierze, przypinanie akcji, współbieżność, cache i wybór runnerów.
  • 100pipelines-github-actions-authoring
    Pomaga pisać workflowy GitHub Actions z akcjami przypiętymi do sprawdzonego commita, minimalnymi uprawnieniami i limitem czasu.
  • 100github-actions
    Przegląda, tworzy szkielety i utwardza zabezpieczenia workflowów GitHub Actions, w tym przypinanie akcji i OIDC do AWS, przy pracy z plikami w .github/workflows.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.