Skip to main content

Sync Actions

Sync repository-level GitHub Actions settings from nova.config.json.

Summary

The sync-actions recipe reconciles whether Actions are enabled, which actions may run, workflow token permissions, pull-request review permission, and artifact retention. It changes repository settings through the GitHub Actions REST API.

An omitted field is not a default: Nova leaves that GitHub setting untouched. An omitted or empty github.actions block produces no mutations.

Why Use This Command?

  1. Prevent a newly created repository from inheriting an accidental Actions policy.
  2. Keep the default GITHUB_TOKEN permission narrow and reviewable.
  3. Reapply allowed-action and retention choices after manual GitHub UI changes.

Requirements

  • gh CLI ≥ 2.40.0 — The GitHub CLI must be installed and authenticated.
  • Repository administration access — The authenticated user must be able to change Actions settings.
  • github.owner and github.repo — Both fields identify the target repository.

Behavior

FieldAllowed valuesWhat it controls
enabledbooleanWhether GitHub Actions may run in the repository.
allowedActionsall, local-only, selectedWhich actions and reusable workflows may run.
shaPinningRequiredbooleanWhether actions must be pinned to a full commit SHA.
selectedActions.githubOwnedbooleanAllows actions authored by GitHub when allowedActions is selected.
selectedActions.verifiedbooleanAllows Marketplace actions from verified creators.
selectedActions.patternsstring[]Allows matching action or reusable-workflow references.
defaultWorkflowPermissionsread, writeDefault GITHUB_TOKEN repository permission.
canApprovePullRequestReviewsbooleanWhether GitHub Actions may create or approve pull-request reviews.
artifactRetentionDaysinteger 1400Default artifact and log retention. GitHub may impose a lower plan-specific max.

enabled is required when allowedActions or shaPinningRequired is configured. selectedActions is valid only with allowedActions: "selected". An explicit empty patterns array is preserved and clears custom allowlist patterns.

Settings

json
{
  "github": {
    "actions": {
      "enabled": true,
      "allowedActions": "selected",
      "shaPinningRequired": true,
      "selectedActions": {
        "githubOwned": true,
        "verified": false,
        "patterns": ["acme/*", "octo-org/octo-repo@*"]
      },
      "defaultWorkflowPermissions": "read",
      "canApprovePullRequestReviews": false,
      "artifactRetentionDays": 30
    }
  },
  "recipes": {
    "github": {
      "sync-actions": {
        "enabled": true
      }
    }
  }
}

Usage

Options

FlagDescription
-d, --dry-runRun read-only checks without changing any GitHub settings.