dcg

GitHub Actions

cicd.github_actions

Protects against destructive GitHub Actions operations like deleting secrets/variables or using gh api DELETE against /actions endpoints.

  • 6blocking rules
  • 7safe patterns
  • 2High
  • 2Medium
  • 2Low
~/.config/dcg/config.toml
[packs]
enabled = ["cicd.github_actions"]

Evaluated when a command contains gh.

Blocking rules

Each rule ID is cicd.github_actions:<name>. Use it in allowlists and [policy.rules].

  1. gh-actions-api-delete-secrets

    High

    gh api DELETE against /actions/secrets deletes GitHub Actions secrets.

    Explanation
    Making DELETE requests to the GitHub Actions secrets API removes secrets from the repository. This bypasses CLI confirmations and directly modifies repository settings. Workflows will fail when referencing deleted secrets. Safer alternatives: - Use gh secret delete for safer deletion with prompts - gh api GET first: Verify secret exists - Prefer CLI commands over direct API calls
  2. gh-actions-secret-remove

    High

    gh secret delete/remove deletes GitHub Actions secrets. This can break CI and may be hard to recover.

    Explanation
    Deleting a GitHub Actions secret removes it from the repository, organization, or environment. Workflows using this secret will fail with authentication or configuration errors. Secret values are not recoverable after deletion. Safer alternatives: - gh secret list: Review existing secrets first - Update the secret value instead of deleting - Check workflow files for secret usage before removing
  3. gh-actions-api-delete-variables

    Medium

    gh api DELETE against /actions/variables deletes GitHub Actions variables.

    Explanation
    Making DELETE requests to the GitHub Actions variables API removes variables from the repository. This bypasses CLI confirmations and directly modifies repository settings. Workflows referencing these variables will fail. Safer alternatives: - Use gh variable delete for safer deletion with prompts - gh api GET first: Verify variable exists - Prefer CLI commands over direct API calls
  4. gh-actions-variable-remove

    Medium

    gh variable delete/remove deletes GitHub Actions variables. This can break workflows.

    Explanation
    Removing a GitHub Actions variable makes it unavailable to all workflows that reference it. Unlike secrets, variable values are visible, but workflows may fail with undefined variable errors after deletion. Safer alternatives: - gh variable list: Review existing variables first - gh variable set: Update value instead of removing - Search workflows for variable usage before removing
  5. gh-actions-run-cancel

    Low

    gh run cancel cancels a running workflow. This is reversible, but may disrupt deployments.

    Explanation
    Canceling a workflow run stops it mid-execution. Any in-progress deployments, tests, or builds will be interrupted. The run can be re-triggered, but partial work may leave systems in an inconsistent state. Safer alternatives: - gh run view: Check run status and progress first - gh run list: Review running workflows - Wait for natural completion if possible
  6. gh-actions-workflow-disable

    Low

    gh workflow disable disables workflows. This is reversible, but can disrupt CI.

    Explanation
    Disabling a workflow prevents it from running on any triggers. This is reversible with 'gh workflow enable', but can disrupt CI/CD pipelines, scheduled jobs, and automated deployments while disabled. Safer alternatives: - gh workflow list: Review workflow status first - gh workflow view: Check workflow details - Use workflow_dispatch for manual control instead

Safe patterns

Checked first. A command that matches one is never blocked by this pack.

  • gh-actions-secret-list
  • gh-actions-variable-list
  • gh-actions-workflow-list
  • gh-actions-workflow-view
  • gh-actions-run-list
  • gh-actions-run-view
  • gh-actions-api-explicit-get