kszucs edited a comment on pull request #11520:
URL: https://github.com/apache/arrow/pull/11520#issuecomment-952978639


   ### Issue
   
   Indeed, the `cancel-in-progress` is rather misleading. Need to read the 
[documentation](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#concurrency)
 thoroughly:
   
   > Concurrency ensures that only a single job or workflow using the same 
concurrency group will run at a time. 
   
   > 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.
   
   Thus once we define `concurrency` then at least the pending jobs are going 
to be canceled. 
   
   ### Solution
   
   In order to "disable" concurrency groups for push events we need to generate 
unique group identifiers for pushes while keeping the pull requests' 
identifiers for pull request events. The following can work:
   
   On push: `apache/arrow-<commit-hash>-<workflow-name>`
   On pull request: `apache/arrow-<pull-request-reference>-<workflow-name>`
   
   ### Implementation
   
   We need to change the currently used `${{ github.ref }}` to another 
expression which conditionally changes based on the event kind. We can use the 
following expression instead: 
   
   ```
   ${{ github.head_ref || github.sha }}
   ```
   
   See `github.head_ref`'s 
[documentation](https://docs.github.com/en/actions/learn-github-actions/contexts#github-context):
   
   > The base_ref or target branch of the pull request in a workflow run. This 
property is only available when the event that triggers a workflow run is 
either pull_request or pull_request_target.
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to