2024-10-03
Quick Ways to Disable GitHub Actions Workflows Without Deletion
GitHub Actions workflows are powerful automation tools, but sometimes you need to temporarily disable them. Here are three simple methods to pause a workflow without deleting its YAML file:
- Comment out the file: Add '#' at the start of each line in the workflow file.
- Use manual triggers: Replace existing triggers with
on: workflow_dispatch
. - Add a false condition: Insert
if: false
under thejobs
key.
Example of method 3
name: My Workflow
on:
push:
branches: [main]
jobs:
if: false # This disables the entire workflow
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# ... rest of the job steps
Tags:
github
github-actions
workflow
ci
yaml