Skip to content

Commit

Permalink
Fix cancelling parallel jobs. (pantsbuild#18439)
Browse files Browse the repository at this point in the history
github.ref will have the branch name. which is wrong. github.sha will
have the git sha which is what we want in this case.


https://docs.github.com/en/actions/learn-github-actions/contexts#github-context

pantsbuild#18374 (comment)
  • Loading branch information
asherf authored Mar 7, 2023
1 parent d88e258 commit f2cdd9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
env:
PANTS_CONFIG_FILES: +['pants.ci.toml']
RUST_BACKTRACE: all
Expand Down
2 changes: 1 addition & 1 deletion build-support/bin/generate_github_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ def generate() -> dict[Path, str]:
{
"name": test_workflow_name,
"concurrency": {
"group": "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}",
"group": "${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}",
"cancel-in-progress": True,
},
"on": {"pull_request": {}, "push": {"branches-ignore": ["dependabot/**"]}},
Expand Down

0 comments on commit f2cdd9b

Please sign in to comment.