GitHub Actions Concurrency Settings | Generated by AI

Home PDF

Your current GitHub Actions workflow configuration already has cancel-in-progress: false, which means it should not cancel in-progress jobs for the gh-pages concurrency group. If jobs are still being canceled, there might be another issue or misconfiguration causing this behavior. Below are steps to verify and fix the issue:

1. Confirm Concurrency Settings

Your configuration looks correct for preventing job cancellations:

concurrency:
  group: 'gh-pages'
  cancel-in-progress: false
name: Deploy to GitHub Pages
on:
  push:
    branches: [ main ]
concurrency:
  group: 'gh-pages'
  cancel-in-progress: false
jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
      # Your steps here

If the concurrency block is misplaced (e.g., inside a job), it won’t work as expected. Move it to the top level if needed.

2. Check for Conflicting Concurrency Settings

3. Verify Workflow Triggers

Jobs might appear to be “canceled” if triggers are misconfigured or if there are race conditions. Check the on section of your workflow:

concurrency:
  group: 'gh-pages-$'
  cancel-in-progress: false

This creates separate concurrency groups for push and pull_request events, preventing them from interfering.

4. Check GitHub Actions Logs

5. Handle Manual Cancellations

If someone manually cancels a workflow run via the GitHub UI, it will stop all jobs in that run, regardless of cancel-in-progress: false. Ensure your team knows not to manually cancel runs unless necessary.

6. Consider Workflow Dependencies

If jobs are being canceled due to dependencies or failures in earlier steps:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      # Build steps
  deploy:
    needs: build
    if: always()
    runs-on: ubuntu-latest
    steps:
      # Deploy steps

7. Test with a Minimal Workflow

If the issue persists, create a minimal test workflow to isolate the problem:

name: Test Concurrency
on:
  push:
    branches: [ main ]
concurrency:
  group: 'gh-pages'
  cancel-in-progress: false
jobs:
  test-job:
    runs-on: ubuntu-latest
    steps:
      - name: Sleep to simulate long job
        run: sleep 60
      - name: Print message
        run: echo "Job completed!"

Push multiple commits to trigger concurrent runs and verify if jobs complete without cancellation.

8. Check GitHub Actions Status

Rarely, GitHub Actions may have platform-wide issues. Check the GitHub Status page or recent posts on X about GitHub Actions outages.

9. Debugging Tips

steps:
  - name: Log run details
    run: echo "Run ID: $, Concurrency Group: $-$"

If It’s Still Not Working

If jobs are still being canceled:

This will help pinpoint the exact issue. Let me know how I can assist further!


Back 2025.05.21 Donate