Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Compare with native concurrency key #76

Closed
ocean90 opened this issue Apr 21, 2021 · 5 comments · Fixed by #201
Closed

Documentation: Compare with native concurrency key #76

ocean90 opened this issue Apr 21, 2021 · 5 comments · Fixed by #201

Comments

@ocean90
Copy link

ocean90 commented Apr 21, 2021

GitHub has announced that workflows "now support a concurrency key at both the workflow and job level that will ensure that only a single run or job is in progress". The syntax documentation has already been updated:

# Example using concurrency to cancel any in-progress job or run
concurrency: 
  group: ${{ github.head_ref }}
  cancel-in-progress: true

I'm wondering if it would be helpful to document in the readme what the differences are and which implementation might be more useful depending on use cases. I think this will be helpful for anyone currently using this action and thinking about switching but even for new users. Any thoughts?

@mikehardy
Copy link
Contributor

That looks really cool - appears to be nice for cases where you want to cancel previous of same workflow - plus obviously for things where you are interested in making sure multiple jobs don't run in parallel

But it does not handle other-workflow cancel or the new (super useful) all_but_latest feature here

@styfle
Copy link
Owner

styfle commented Apr 22, 2021

Very cool! Looks like its still in beta and subject to change though.

https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency

@mcramer-billgo
Copy link

Trying to implement the concurrency at the job level in a multi-job workflow and getting a properties error.

.github/workflows/deploy-gluon-api.yml failed test
[
  {
    instancePath: '/jobs/deploy-dev-canary',
    schemaPath: '#/properties/jobs/patternProperties/%5E%5B_a-zA-Z%5D%5Ba-zA-Z0-9_-%5D*%24/additionalProperties',
    keyword: 'additionalProperties',
    params: { additionalProperty: 'concurrency' },
    message: 'must NOT have additional properties'
  }
]

implementation in workflow for context:

jobs:
  job1:
  ...

  deploy-dev-canary:
    concurrency:
      group: ${{ github.ref }}
      cancel-in-progress: true
    environment:
      name: "appname-dev-canary"
    needs: setup
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      ...

What is wrong with my implementation at the job level?

@styfle
Copy link
Owner

styfle commented Feb 15, 2022

Also mentioned here #133 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants