GitHub Actions workflow that checks if branch is
master before running job
# .github/workflows/check.yml on: push jobs: master-check: if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest steps: - run: echo "Running on branch $GITHUB_REF"
if conditional checks that the branch is
if: github.ref == 'refs/heads/master'
To skip the
master branch, use the
if: github.ref != 'refs/heads/master'
See GitHub Actions documentation example.