Skip to content

Repository files navigation

workistrator

workistrator is a GitHub Action that you can you use to manage your GitHub workflows across many repositories centrally.

It takes template workflows from the parent repository and creates or updates them in children repositories.

Usage

Put your template workflows (*.yml / *.yaml) in a directory of the parent repository (workflow-templates/ by default), then run workistrator from a workflow in that same repository:

name: Sync Workflows with Workistrator

on:
  push:
    branches: [main]
    paths: [workflow-templates/**]
  workflow_dispatch:

jobs:
  sync:
    runs-on: ubuntu-latest
    steps:
      - uses: cutenode/workistrator@v1
        with:
          token: ${{ secrets.WORKISTRATOR_TOKEN }}
          repositories: |
            cutenode/repo-one
            repo-two

Each child repository gets a single commit containing every template that was created or changed. Templates that already match are left alone, and workflows in the child that don't come from a template are never touched.

The default GITHUB_TOKEN can't write to other repositories, so token must be a fine-grained personal access token or GitHub App token with Contents: read on the parent repository and Contents: write and Workflows: write on every child repository.

Inputs

Input Required Default Description
token yes Token used to read templates and write to child repositories.
repositories yes Newline- or comma-separated child repositories as owner/repo. Bare names use the parent repository's owner.
templates-path no workflow-templates Directory in the parent repository that holds the templates.
target-path no .github/workflows Directory in each child repository the templates are written to.
branch no default branch Branch to commit to in each child repository.
commit-message no chore(workistrator): sync workflows from <owner>/<repo> Commit message used in child repositories.
dry-run no false Report what would change without committing.

Outputs

Output Description
results JSON array with the branch, commit, and per-file status (created, updated, unchanged) for each repository.
created Number of workflow files created.
updated Number of workflow files updated.
unchanged Number of workflow files that were already up to date.

If any repository fails to sync, the remaining repositories are still processed and the step fails at the end with a list of the failures.

Development

npm install
npm test
npm run format
npm run lint
npm run build

npm test runs the Vitest suite with coverage and fails if any file drops below 95%.

npm run build packages the action into dist/: swc compiles src/, and the production dependencies are copied into dist/node_modules so the action runs without an install step. action.yml runs dist/index.js, so rebuild and commit dist/ whenever the source or dependencies change.

About

GitHub Workflow Orchistrator

Resources

Code of conduct

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages