1

I have a workflow that is triggered on the following events:

on:
  pull_request:
    types:
      - opened
      - synchronize
      
  pull_request_review:
    types:
      - submitted

If there are two jobs in queue with the synchronized event then the latest job needs to be considered and the other jobs in queue needs to be cancelled.

If there are two jobs waiting in the queue one with a pull request synchronized event and another with a pull request review event, how to set concurrency in such a way that the pull review review event gets triggered after the pull request synchronized event.

Swathi DA
  • 51
  • 4
  • 1
    According to [Using concurrency](https://docs.github.com/en/actions/using-jobs/using-concurrency), "**When a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled. To also cancel any currently running job or workflow in the same concurrency group, specify `cancel-in-progress: true`.**". From this description, looks like you can use this **pending** behavior to achieve this. – Azeem Feb 06 '23 at 08:02

0 Answers0