Using the GitHub REST API or CLI, how do you disable a workflow so it no longer triggers?
Select an answer to reveal the explanation.
Short Explanation and Infographic
The /disable endpoint (API) or 'gh workflow disable' (CLI) pauses a workflow without deleting the file — reversible anytime.
Full explanation below image
Full Explanation
To disable a workflow without deleting it: REST API: 'PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable'; GitHub CLI: 'gh workflow disable {workflow-name-or-id}'. To re-enable: 'PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable' or 'gh workflow enable'. The DELETE method deletes the workflow run history, not the workflow itself. Moving to '.github/disabled/' is a manual convention that doesn't actually disable it — GitHub still processes any .yml files in '.github/workflows/'. There's no 'active: false' field in workflow YAML.