Skip to main content

This version of GitHub Enterprise was discontinued on 2023-07-06. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.

Disabling and enabling a workflow

You can disable and re-enable a workflow using the GitHub UI, the REST API, or GitHub CLI.

Note: GitHub-hosted runners are not currently supported on GitHub Enterprise Server. You can see more information about planned future support on the GitHub public roadmap.

Disabling a workflow allows you to stop a workflow from being triggered without having to delete the file from the repo. You can easily re-enable the workflow again on GitHub.

Temporarily disabling a workflow can be useful in many scenarios. These are a few examples where disabling a workflow might be helpful:

  • A workflow error that produces too many or wrong requests, impacting external services negatively.
  • A workflow that is not critical and is consuming too many minutes on your account.
  • A workflow that sends requests to a service that is down.
  • Workflows on a forked repository that aren't needed (for example, scheduled workflows).

Warning: To prevent unnecessary workflow runs, scheduled workflows may be disabled automatically. When a public repository is forked, scheduled workflows are disabled by default. In a public repository, scheduled workflows are automatically disabled when no repository activity has occurred in 60 days.

You can also disable and enable a workflow using the REST API. For more information, see the "Actions."

Disabling a workflow

  1. On your GitHub Enterprise Server instance, navigate to the main page of the repository.

  2. Under your repository name, click Actions.

    Screenshot of the tabs for the "github/docs" repository. The "Actions" tab is highlighted with an orange outline.

  3. In the left sidebar, click the workflow you want to disable.

  4. Click to display a dropdown menu and click Disable workflow.

    Screenshot of a workflow. Features apart from the "Disable workflow" menu item are grayed out.

    The disabled workflow is marked to indicate its status.

    Screenshot showing the actions list. The name of the disabled "Greet Everyone" workflow is prefixed with a stop icon.

To learn more about GitHub CLI, see "About GitHub CLI."

To disable a workflow, use the workflow disable subcommand. Replace workflow with either the name, ID, or file name of the workflow you want to disable. For example, "Link Checker", 1234567, or "link-check-test.yml". If you don't specify a workflow, GitHub CLI returns an interactive menu for you to choose a workflow.

gh workflow disable WORKFLOW

Enabling a workflow

You can re-enable a workflow that was previously disabled.

  1. On your GitHub Enterprise Server instance, navigate to the main page of the repository.

  2. Under your repository name, click Actions.

    Screenshot of the tabs for the "github/docs" repository. The "Actions" tab is highlighted with an orange outline.

  3. In the left sidebar, click the workflow you want to enable.

    Screenshot of the "Actions" page. Features are grayed out apart from one workflow name in the left sidebar.

  4. Click Enable workflow.

To enable a workflow, use the workflow enable subcommand. Replace workflow with either the name, ID, or file name of the workflow you want to enable. For example, "Link Checker", 1234567, or "link-check-test.yml". If you don't specify a workflow, GitHub CLI returns an interactive menu for you to choose a workflow.

gh workflow enable WORKFLOW