[llvm] [Github] Cancel previous in-progress code formatting jobs (PR #106701)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 30 03:12:58 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-github-workflow

Author: Aiden Grossman (boomanaiden154)

<details>
<summary>Changes</summary>

If the user pushes multiple times in relatively rapid succession, we might end up with multiple code formatting jobs in flight at the same time for different revisions of the same PR. It makes no sense to keep jobs running on outdated versions of the PR.

Additionally, if my hypothesis proves correct, this might end up fixing

---
Full diff: https://github.com/llvm/llvm-project/pull/106701.diff


1 Files Affected:

- (modified) .github/workflows/pr-code-format.yml (+3) 


``````````diff
diff --git a/.github/workflows/pr-code-format.yml b/.github/workflows/pr-code-format.yml
index 1a1700b75cfdb7..f2bb37316d3a8b 100644
--- a/.github/workflows/pr-code-format.yml
+++ b/.github/workflows/pr-code-format.yml
@@ -13,6 +13,9 @@ jobs:
   code_formatter:
     runs-on: ubuntu-latest
     timeout-minutes: 30
+    concurrency:
+      group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
+      cancel-in-progress: true
     if: github.repository == 'llvm/llvm-project'
     steps:
       - name: Fetch LLVM sources

``````````

</details>


https://github.com/llvm/llvm-project/pull/106701


More information about the llvm-commits mailing list