runner: `concurrency` with properties now causes "syntax error"

By making a trivial change to an existing test_build.yaml, GitHub Actions complains about a syntax error in the concurrency property.

Invalid workflow file : .github/workflows/test_build.yaml#L3
You have an error in your yaml syntax on line 3
  • I’m running in the github.com Actions environment, not my own.
  • If I re-order the properties it remains broken.
  • If I remove the properties from concurrency it works again.
  • I’ve validated that the yaml is valid yaml. So the error is confusing and unhelpful.

Note: This exact yaml file has been working for months. The only change I made was to rename a job.

Broken Example

name: Project CI
concurrency:
  cancel-in-progress: true  # "Syntax error" here?
  group: muffins
on:
  pull_request:
    branches: [devel, staging, prod]
  push:
    branches: [devel, staging, prod]
jobs:
  test_ui:
    defaults:
      run:
        working-directory: ./ui
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v2
      - name: Install Node
        uses: actions/setup-node@v2
        with:
          node-version: 16
      - run: npm ci
      - run: npm run validate

Working Example

name: Project CI
concurrency: muffins
on:
  pull_request:
    branches: [devel, staging, prod]
  push:
    branches: [devel, staging, prod]
jobs:
  test_ui:
    defaults:
      run:
        working-directory: ./ui
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v2
      - name: Install Node
        uses: actions/setup-node@v2
        with:
          node-version: 16
      - run: npm ci
      - run: npm run validate

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 72
  • Comments: 30 (2 by maintainers)

Commits related to this issue

Most upvoted comments

I don’t think I’m the biggest fan of the “silently fix the issue without acknowledging its existence” approach that GitHub seems to have taken here, but I suppose I’m glad that my workflow is working again.

I have also posted an issue about this on the community page: https://github.community/t/breaking-change-to-concurrency-group-syntax/215604

A lot of folks appear to be affected by this.

It seems that the original problem is no-longer happening. I reverted to my original .yaml file and it works now without complaining about a syntax error.

This wasn’t a runner bug, so I don’t have complete details.

We were making a change to the way concurrency is supported for reusable workflows and introduced a bug parsing some workflows with groups specified under concurrency. We rolled back the feature changes when we became aware of problems in production. We’ve added additional monitoring and tests for these configurations so that we will not have similar issues in the future.

@ethomson Could you elaborate on the incident a bit? Instead of just closing it…?

In a response from GitHub I was told engineers were on it before reports came in. Anyways, still this issue is open at this point.

People, do everyone a favor and instead of useless “+1” or “me too” or similar comments, hit the thumbs up button on the original post. Thank you.

My guess is they noticed by elevated numbers of builds failing and rolled back the change before the support message made it to them.

Can confirm, getting the same error with this configuration:

concurrency:
  group: ${{ github.ref }}
  cancel-in-progress: true

FTR, fails for https://github.com/quarkusio/quarkus as well:

concurrency:
  group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}"
  cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'quarkusio/quarkus' }}

Confirmed, reverting worked for us as well. Thanks for keeping us posted @ablakey 👍

We’re experiencing this as well; our current workaround:

concurrency:
  group: ${{ (github.event_name == 'pull_request' && github.event.pull_request.number) || github.head_ref }}
  cancel-in-progress: true

+1 we’ve got the same issue on all of our repositories and all syntax issues are pointing at the concurrency property.