Logo di Github Actions Centralized Reusable Workflows

Github Actions Centralized Reusable Workflows

Community
selvarajmurugesan90
github-actions-centralized-reusable-workflows

Designs organization-level reusable GitHub Actions workflows (workflow_call) and shared composite actions hosted in a dedicated repo, so many repos call one standardized pipeline definition instead of duplicating workflow YAML. Use when the user asks to "centralize our GitHub Actions workflows," "create a reusable workflow with workflow_call," "enforce a standard CI pipeline across all repos," "version a shared composite action," or "reduce duplicated workflow YAML across the organization."

Panoramica

Autoreselvarajmurugesan90
Repositoryops-engineering-skills
Nome della skillgithub-actions-centralized-reusable-workflows
Stelle
44
Fork
18
File inclusi
Solo istruzioni
LicenzaApache-2.0
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da selvarajmurugesan90 su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Github Actions Centralized Reusable Workflows in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/selvarajmurugesan90/ops-engineering-skills/tree/main/plugins/cicd-tooling/skills/github-actions-centralized-reusable-workflows
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Nuova skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella nella cartella delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/selvarajmurugesan90/ops-engineering-skills.git /tmp/ops-engineering-skills
mkdir -p .claude/skills
cp -r /tmp/ops-engineering-skills/plugins/cicd-tooling/skills/github-actions-centralized-reusable-workflows .claude/skills/github-actions-centralized-reusable-workflows
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Github Actions Centralized Reusable Workflows in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Github Actions Centralized Reusable Workflows non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Github Actions Centralized Reusable Workflows non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

GitHub Actions Centralized Reusable Workflows

Purpose

When the same workflow YAML — build, test, security scan, deploy — is copy-pasted across dozens of repos (github-actions-single-repo-workflows covers that per-repo pattern), a policy change (a new required scan, a registry migration) requires editing every repo individually and drifts immediately. GitHub Actions solves this at the organization level with reusable workflows (workflow_call), which let a caller workflow in any repo invoke one centrally-maintained workflow definition with inputs/ secrets, and shared composite actions hosted in a dedicated repo for smaller reusable step sequences. This skill covers designing, versioning, and rolling out that centralized pattern so many repos consume one standardized pipeline rather than diverging copies.

When to use

  • More than a handful of repos have near-identical .github/workflows/*.yml files and a change requires updating each one individually.
  • Standing up an organization-wide CI/CD standard (e.g. "every service repo must run this exact set of security gates before deploy") that individual teams shouldn't be able to silently drift from.
  • An existing reusable workflow needs a new input/secret, or a breaking change that must be versioned so callers can opt in on their own schedule.
  • Deciding whether a step sequence belongs in a per-repo composite action (see github-actions-single-repo-workflows) versus a centrally-hosted one consumed by many repos.
  • Migrating from Jenkins shared libraries to GitHub Actions and wanting the equivalent centralization model — compare with jenkins-centralized-shared-library.

Prerequisites & environment

  • A dedicated repository to host reusable workflows/composite actions (commonly .github at the org level for org-wide defaults, or a purpose-named repo like actions-library).
  • Organization (or repo, for repo-scoped reuse) admin access to configure which repos may call reusable workflows: Organization Settings → Actions → General → "Access" for reusable workflows and actions, since by default a private reusable workflow is only callable from repos in the same organization unless explicitly opened up.
  • Caller repos need permissions: granted appropriately, since a reusable workflow runs with the permissions the caller grants it, not its own hardcoded defaults.
  • Secrets: either passed explicitly via secrets: inherit (simplest, but passes everything the caller has) or named individually (secrets: { DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }} }, more auditable about exactly what the reusable workflow receives).
  • Semantic version tags (or at minimum SHA pinning discipline) on the reusable-workflow repo so callers can pin a version rather than track @main.

Step-by-step guidance

  1. Define the reusable workflow with workflow_call as its trigger, declaring explicit inputs: and secrets: — this is what makes it callable from another repo rather than only runnable in its own repo:

    yaml
    # .github/workflows/standard-node-ci.yml  (in org/actions-library)
    name: standard-node-ci
    on:
      workflow_call:
        inputs:
          node-version:
            type: string
            default: "20"
          deploy-target:
            type: string
            required: false
        secrets:
          DEPLOY_TOKEN:
            required: false
    jobs:
      test:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
          - uses: actions/setup-node@v4
            with: { node-version: ${{ inputs.node-version }}, cache: "npm" }
          - run: npm ci
          - run: npm test
    
      deploy:
        needs: test
        if: inputs.deploy-target != ''
        runs-on: ubuntu-latest
        environment: ${{ inputs.deploy-target }}
        steps:
          - run: ./deploy.sh ${{ inputs.deploy-target }}
            env:
              DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
  2. Call it from a consumer repo with a pinned version, keeping the caller workflow thin:

    yaml
    # .github/workflows/ci.yml  (in org/checkout-api)
    name: ci
    on:
      pull_request:
        branches: [main]
      push:
        branches: [main]
    jobs:
      ci:
        uses: org/actions-library/.github/workflows/standard-node-ci.yml@v1.3.0
        with:
          node-version: "20"
          deploy-target: staging
        secrets:
          DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}

    Pin @v1.3.0 (a tag), not @main — the same versioning discipline as a Jenkins shared library (see jenkins-centralized-shared-library for the direct analog).

  3. Use secrets: inherit only when the caller repo's full secret set is genuinely intended for the reusable workflow — otherwise pass secrets explicitly by name so it's auditable exactly what a centrally-maintained workflow can access from each caller.

  4. Host smaller, non-workflow reusable pieces as composite actions in the same or a sibling repo, versioned the same way:

    yaml
    # org/actions-library/setup-node-env/action.yml
    name: "Setup Node env (org standard)"
    runs:
      using: "composite"
      steps:
        - uses: actions/setup-node@v4
          with: { node-version: "20", cache: "npm" }
        - run: npm ci
          shell: bash

    Consumed as:

    yaml
    - uses: org/actions-library/setup-node-env@v1.3.0
  5. Nest reusable workflows sparingly — GitHub Actions allows calling a reusable workflow from within another reusable workflow up to a depth limit (4 levels as of current GitHub Actions); design the org's standard workflows as a shallow, well-documented hierarchy rather than deep nesting that's hard to trace.

  6. Version and changelog the library repo deliberately: tag releases, document each inputs:/secrets: change, and treat removing or renaming an input as a breaking (major) change requiring caller migration, exactly like a public API.

  7. Roll out breaking changes gradually: cut a new major tag, migrate a few pilot repos to @v2.0.0, validate, then open individual PRs against the remaining caller repos to bump the pin — never silently rewrite the floating @main ref that other repos might still be depending on and never bulk-force-push changes into consumer repos' workflow files without their own review.

  8. Enforce adoption, don't just offer it, via a required organization ruleset or a periodic audit (e.g. a scheduled workflow that scans repos for .github/workflows/*.yml files that don't call the standard reusable workflow) if the goal is a hard organization-wide standard rather than an opt-in convenience.

Best practices

  • Pin callers to a tagged version (@v1.3.0) or full commit SHA, never @main, for the same reason third-party actions should be pinned — see github-actions-single-repo-workflows.
  • Keep the reusable workflow's inputs:/secrets: surface small and well-documented (a table in the library repo's README); every input should have a sensible default unless it's genuinely required.
  • Prefer named secrets: passing over secrets: inherit for anything security-sensitive, so an audit of the reusable workflow's YAML alone shows exactly what secrets it can touch.
  • Give the reusable-workflow repo its own tests: a workflow in that same repo that calls the reusable workflow against a throwaway/sample scenario on every change, so a broken reusable workflow is caught before a version tag goes out to every caller.
  • Grant the minimum permissions: needed in the caller workflow — a reusable workflow only gets the permissions the caller's job explicitly passes down, so scoping the caller tightly protects every repo that invokes the shared workflow.
  • Document a clear deprecation/migration path (a fixed window, e.g. 90 days) when retiring an old major version, mirroring the same discipline used for Jenkins shared library majors — see jenkins-centralized-shared-library.

Common pitfalls

  • Symptom: A caller repo's deploy step fails with "secret not found" even though the secret clearly exists in that repo's settings. Fix: Reusable workflows do not automatically inherit the caller's secrets — either add secrets: inherit at the call site, or pass the specific secret explicitly (secrets: { DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }} }); a workflow_call job with an undeclared secret input silently receives nothing.

  • Symptom: Updating the reusable workflow's main branch immediately changes behavior for every caller repo pinned to @main, breaking several simultaneously. Fix: This is the cost of unpinned callers; migrate all callers to pin an explicit version tag, and treat @main as for the library repo's own testing only, never as a supported caller reference.

  • Symptom: A private reusable workflow works when called from one repo but a different repo in the same org gets "workflow was not found" or an access-denied error. Fix: Check Organization Settings → Actions → General → Access for reusable workflows — a private reusable workflow's repo must explicitly allow access from the calling repo (or the org broadly), it is not automatically callable org-wide by default.

  • Symptom: Adding a new required input to the reusable workflow breaks every caller simultaneously the moment it merges. Fix: Give new inputs a default: value for a minor version so existing callers keep working unchanged; reserve genuinely required new inputs for a major version bump callers must opt into.

  • Symptom: Someone deletes an old reusable-workflow version tag or renames the hosting repo without checking who still references it, breaking pipelines across the org simultaneously with no warning. Fix: Before deleting a version tag or moving/renaming the actions-library repo, search caller repos (e.g. a GitHub code search for uses: org/actions-library/.github/workflows/standard-node-ci.yml@v1) for references still pinned to that tag/path — treat this the same as the "don't delete a still-referenced Jenkins shared library version" warning in jenkins-centralized-shared-library.

Worked example

Scenario: An organization has 40 Node.js service repos, each duplicating a nearly-identical CI/CD workflow. They centralize into one reusable workflow so each repo's caller file is ~10 lines, and adding a new required security scan later needs only one PR to the library repo plus each caller bumping its version pin.

org/actions-library/.github/workflows/standard-node-ci.yml (excerpt adding a scan stage in v1.4.0):

yaml
on:
  workflow_call:
    inputs:
      node-version: { type: string, default: "20" }
    secrets:
      DEPLOY_TOKEN: { required: false }
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: ${{ inputs.node-version }}, cache: "npm" }
      - run: npm ci && npm test

  security-scan:
    needs: test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: aquasecurity/trivy-action@0.24.0
        with: { scan-type: 'fs', severity: 'CRITICAL,HIGH', exit-code: '1' }

  deploy:
    needs: security-scan
    if: github.ref == 'refs/heads/main'
    runs-on: ubuntu-latest
    environment: staging
    steps:
      - run: ./deploy.sh staging
        env: { DEPLOY_TOKEN: "${{ secrets.DEPLOY_TOKEN }}" }

Caller repo (org/checkout-api/.github/workflows/ci.yml), unchanged except bumping the version pin when ready to adopt the new scan stage:

yaml
name: ci
on:
  pull_request: { branches: [main] }
  push: { branches: [main] }
jobs:
  ci:
    uses: org/actions-library/.github/workflows/standard-node-ci.yml@v1.4.0
    with: { node-version: "20" }
    secrets:
      DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}

Each of the 40 repos bumps @v1.3.0 → @v1.4.0 on its own schedule via a one-line PR, instead of 40 separate workflow-file rewrites to add the security-scan job.

Cross-references

Domande frequenti

Cosa fa la skill IA Github Actions Centralized Reusable Workflows?

Designs organization-level reusable GitHub Actions workflows (workflow_call) and shared composite actions hosted in a dedicated repo, so many repos call one standardized pipeline definition instead of duplicating workflow YAML. Use when the user asks to "centralize our GitHub Actions workflows," "create a reusable workflow with workflow_call," "enforce a standard CI pipeline across all repos," "version a shared composite action," or "reduce duplicated workflow YAML across the organization."

Perché usare Github Actions Centralized Reusable Workflows su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Github Actions Centralized Reusable Workflows è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Github Actions Centralized Reusable Workflows in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/selvarajmurugesan90/ops-engineering-skills/tree/main/plugins/cicd-tooling/skills/github-actions-centralized-reusable-workflows. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Github Actions Centralized Reusable Workflows?

Qualsiasi modello che colleghi in TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Github Actions Centralized Reusable Workflows?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Github Actions Centralized Reusable Workflows: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Github Actions Centralized Reusable Workflows è gratuita?

Sì. È pubblicata su GitHub da selvarajmurugesan90 con licenza Apache-2.0. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, modelli o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇