Skip to content

Workflow canceled when using concurrency and a child job with a reusable workflow #30708

Answered by Badisi
Badisi asked this question in Actions
Discussion options

You must be logged in to vote

To anyone interested in this issue, here is the detailed explanation and how to fix it :

Explanation

The main issue was that a called workflow uses its caller's name when using ${{ github.workflow }}

name: Build app
on:
  workflow_dispatch:
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }} # <-- 1. will be reserved as "Build app-..."
  cancel-in-progress: true
jobs:
  ci_tests:
    uses: ./.github/workflows/ci_tests.yml # <-- 3. will be reserved as "Build app-..."
    concurrency:
      group: Run tests-${{ github.ref }} # <-- 2. will be reserved as "Run tests-..."
      cancel-in-progress: true
  ci_build:
    needs: ci_tests
    runs-on: ubuntu-latest
    steps:
      - run

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Badisi
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Product Feedback
3 participants