-
I'm using the following 2 GitHub actions workflows (can be seen on this Code Reproduction repository):
name: Run tests
on:
workflow_call:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci_tests:
runs-on: ubuntu-latest
steps:
- run: sleep 30
name: Build app
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci_tests:
uses: ./.github/workflows/ci_tests.yml
ci_build:
needs: ci_tests
runs-on: ubuntu-latest
steps:
- run: sleep 30 Both workflow uses their own concurrency group so that anytime a workflow of the same type is triggered, the previous one that is still running could be cancelled. Issue
Obviously there are no other workflow (2) running in each case, so the issue is kinda misleading. Is it an issue with gh's actions or am I missing something ? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Hi,
Word "ONLY" probably explains why it doesn't work for you. |
Beta Was this translation helpful? Give feedback.
-
I could think it has to generate some error instead of working in some really weird way you face due to it. |
Beta Was this translation helpful? Give feedback.
-
@ViacheslavKudinov, thanks for trying to help me out! To me, "only" simply means that when using a reusable workflow you can't use other properties like "steps", etc. Anyhow, I tried using name: Build app
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci_tests:
concurrency:
group: Run tests-${{ github.ref }}
cancel-in-progress: true
uses: ./.github/workflows/ci_tests.yml
ci_build:
needs: ci_tests
runs-on: ubuntu-latest
steps:
- run: sleep 30 But I'm still facing the issue where it says that Build app is also canceled due to another identical request already existing.
This really doesn't make sense to me and seems more like a bug on GitHub's actions side. |
Beta Was this translation helpful? Give feedback.
-
To anyone interested in this issue, here is the detailed explanation and how to fix it : Explanation
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: sleep 30
Fix
name: Run tests
on:
workflow_call:
workflow_dispatch:
concurrency:
group: tests-${{ github.ref }} # <-- 1. will be reserved as "tests-..."
cancel-in-progress: true
jobs:
ci_tests:
runs-on: ubuntu-latest
steps:
- run: sleep 30 name: Build app
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }} # <-- 2. will be reserved as "Build app-..."
cancel-in-progress: true
jobs:
ci_tests:
uses: ./.github/workflows/ci_tests.yml # <-- 3. will be reserved as "tests-..."
ci_build:
needs: ci_tests
runs-on: ubuntu-latest
steps:
- run: sleep 30
|
Beta Was this translation helpful? Give feedback.
-
This answered my similar problem. In my case, the concurrency group I was setting on a job which used a reusable workflow was coming back with blank strings instead of the variables I was trying to use. It appears to come down to this:
|
Beta Was this translation helpful? Give feedback.
To anyone interested in this issue, here is the detailed explanation and how to fix it :
Explanation