Exclude a specific job from workflow concurrency #124123
Replies: 2 comments
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
@nikostitoworkable did you find a solution for this? I would like to setup something similar |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
I have a workflow with 3 jobs. I am using concurrency with
cancel-in-progress: true
, so that the workflow will cancel if another run is started for the same branch. But I wanted to exclude the last job of the workflow run, in a way that if the workflow has reached the last job, the job won't get canceled by another enqueued job and will be executed. I saw that we can pass a logical expression to cancel-in-progress key and could add something like:cancel-in-progress: ${{ github.job != 'last_job' }}
but my first job uses test matrixes and I can see there is an issue where only the last initialised matrix job will start executing and not get canceled. So I really can't use job level concurrency. Is there a more elegant way of ignoring cancel-in-progress only for a specific job, except of settingif: always()
to that job?Beta Was this translation helpful? Give feedback.
All reactions