Skip to content

Unable to queue more than a single run in a concurrency group #2227

@jgreat

Description

@jgreat

Describe the bug
Yes this is a duplicate of closed #1523

Github Actions will cancel intermediate runs when additional triggers happen. This happens even with concurrency.cancel-in-progress: false.

  • Push number 1 will trigger a ci.yaml workflow and start a run.
  • Push number 2 will queue a run.
  • Push number 3 will cancel push number 2 and then queue a run for the commit on 3.

This is probably fine for a usual use case of grouping runs by ${{ github.workflow }}-${{ github.ref }}, but isn't the desired behavior if you want to use other identifiers to limit your concurrent runs.

Use case:

I want to limit concurrency by github.actor so dependabot doesn't blow up our self-hosted runners. Dependabot automation cannot be depended on (see what I did there) to honor the set scheduling when synchronizing existing PRs. This consumes all of our self-hosted runner resources.

Limitations faced:

Desired logic:

  • Limit to one concurrent process on master and release/*.
  • Limit other events, PRs and other branches, by actor (user or dependabot).
  • Cancel in progress if master or release/*, but keep queue for PRs and other actors.

To Reproduce

Example concurrency block:

concurrency:
  # Limit to one concurrent process on master and release/*.
  # Limit other events, PRs and other branches, by actor (user or dependabot).
  group: ${{ github.workflow }}-${{ ( github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/') ) && github.ref || github.actor }}
  # Cancel in progress if master or release/*, but keep queue for PRs and other actors.
  cancel-in-progress: ${{ ( github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/') )}}

Runs showing canceled intermediate:
image

Push 2 now shows:

Canceling since a higher priority waiting request for 'CI-jgreat' exists

The concurrency group of CI-jgreat makes sense based on the group logic 👍

Expected behavior

3 queued jobs that would run one after the other. If I wanted to skip an intermediate job I would manually cancel that job. These jobs may be queued up across multiple PRs or branches.

Runner Version and Platform

Version of your runner? - v2.298.2

OS of the machine running the runner? OSX/Windows/Linux/... - Linux Ubuntu 20.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions