[llvm] Users/tstellar/upload self contained (PR #213828)

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 4 06:30:16 PDT 2026


https://github.com/tstellar updated https://github.com/llvm/llvm-project/pull/213828

>From 94f8dc842faacdc692efb2912ec0e9f9d0a3e08d Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Sat, 1 Aug 2026 09:28:18 -0700
Subject: [PATCH 1/3] workflows/upload-release-artifact: Make this action
 self-contained

The action now checks out its own files so calling worklfows don't need
to do this.  This helps prevent mistakes where the calling workflow
does not checkout the right files causing this action to fail.
---
 .../upload-release-artifact/action.yml        | 28 +++++++++++++------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/upload-release-artifact/action.yml b/.github/workflows/upload-release-artifact/action.yml
index 81a7e906ae150..0ad5100f8de71 100644
--- a/.github/workflows/upload-release-artifact/action.yml
+++ b/.github/workflows/upload-release-artifact/action.yml
@@ -41,6 +41,23 @@ inputs:
 runs:
   using: "composite"
   steps:
+    - name: Check Permissions
+      uses: $/.github/workflows/require-team-membership
+      with:
+        team-slug: llvm-release-managers
+        LLVM_TOKEN_GENERATOR_CLIENT_ID: ${{ inputs.LLVM_TOKEN_GENERATOR_CLIENT_ID }}
+        LLVM_TOKEN_GENERATOR_PRIVATE_KEY: ${{ inputs.LLVM_TOKEN_GENERATOR_PRIVATE_KEY }}
+
+    # Checkout the files used by this action.
+     - uses: actions/checkout at df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
+       with:
+         persist-credentials: false
+         path: upload-release-artifact
+         sparse-checkout: |
+            llvm/utils/release/github-upload-release.py
+            llvm/utils/git/requirements.txt
+         sparse-checkout-cone-mode: false
+
     - name: Validate Input
       uses: $/.github/workflows/validate-release-version
       with:
@@ -99,14 +116,7 @@ runs:
       if: inputs.upload == 'true'
       shell: bash
       run: |
-        pip install --require-hashes -r ./llvm/utils/git/requirements.txt
-
-    - name: Check Permissions
-      uses: $/.github/workflows/require-team-membership
-      with:
-        team-slug: llvm-release-managers
-        LLVM_TOKEN_GENERATOR_CLIENT_ID: ${{ inputs.LLVM_TOKEN_GENERATOR_CLIENT_ID }}
-        LLVM_TOKEN_GENERATOR_PRIVATE_KEY: ${{ inputs.LLVM_TOKEN_GENERATOR_PRIVATE_KEY }}
+        pip install --require-hashes -r ./upload-release-artifact/llvm/utils/git/requirements.txt
 
     - name: Upload Release
       shell: bash
@@ -115,7 +125,7 @@ runs:
         INPUTS_RELEASE_VERSION: ${{ inputs.release-version }}
         DOWNLOAD_PATH: ${{ steps.download-artifact.outputs.download-path }}
       run: |
-        ./llvm/utils/release/github-upload-release.py \
+        ./upload-release-artifact/llvm/utils/release/github-upload-release.py \
         --token ${{ github.token }} \
         --release "$INPUTS_RELEASE_VERSION" \
         upload \

>From f690eb55b8970cd74782cb7e93bd66655b41005e Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Tue, 4 Aug 2026 05:03:53 -0700
Subject: [PATCH 2/3] Fix indnetation

---
 .../workflows/upload-release-artifact/action.yml | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/upload-release-artifact/action.yml b/.github/workflows/upload-release-artifact/action.yml
index 0ad5100f8de71..7c17137f55c19 100644
--- a/.github/workflows/upload-release-artifact/action.yml
+++ b/.github/workflows/upload-release-artifact/action.yml
@@ -49,14 +49,14 @@ runs:
         LLVM_TOKEN_GENERATOR_PRIVATE_KEY: ${{ inputs.LLVM_TOKEN_GENERATOR_PRIVATE_KEY }}
 
     # Checkout the files used by this action.
-     - uses: actions/checkout at df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
-       with:
-         persist-credentials: false
-         path: upload-release-artifact
-         sparse-checkout: |
-            llvm/utils/release/github-upload-release.py
-            llvm/utils/git/requirements.txt
-         sparse-checkout-cone-mode: false
+    - uses: actions/checkout at df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
+      with:
+        persist-credentials: false
+        path: upload-release-artifact
+        sparse-checkout: |
+           llvm/utils/release/github-upload-release.py
+           llvm/utils/git/requirements.txt
+        sparse-checkout-cone-mode: false
 
     - name: Validate Input
       uses: $/.github/workflows/validate-release-version

>From 0d1ffee6d43ec1e03eba67f279fc7bb852a4b608 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Tue, 4 Aug 2026 05:06:08 -0700
Subject: [PATCH 3/3] Move checkout and gate it on upload

---
 .../upload-release-artifact/action.yml        | 21 ++++++++++---------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/upload-release-artifact/action.yml b/.github/workflows/upload-release-artifact/action.yml
index 7c17137f55c19..c91e238ac0fab 100644
--- a/.github/workflows/upload-release-artifact/action.yml
+++ b/.github/workflows/upload-release-artifact/action.yml
@@ -48,16 +48,6 @@ runs:
         LLVM_TOKEN_GENERATOR_CLIENT_ID: ${{ inputs.LLVM_TOKEN_GENERATOR_CLIENT_ID }}
         LLVM_TOKEN_GENERATOR_PRIVATE_KEY: ${{ inputs.LLVM_TOKEN_GENERATOR_PRIVATE_KEY }}
 
-    # Checkout the files used by this action.
-    - uses: actions/checkout at df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
-      with:
-        persist-credentials: false
-        path: upload-release-artifact
-        sparse-checkout: |
-           llvm/utils/release/github-upload-release.py
-           llvm/utils/git/requirements.txt
-        sparse-checkout-cone-mode: false
-
     - name: Validate Input
       uses: $/.github/workflows/validate-release-version
       with:
@@ -111,6 +101,17 @@ runs:
         name: ${{ inputs.attestation-name }}
         path: |
           *.jsonl
+    
+    # Checkout the files used by this action.
+    - uses: actions/checkout at df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
+      if: inputs.upload == 'true'
+      with:
+        persist-credentials: false
+        path: upload-release-artifact
+        sparse-checkout: |
+           llvm/utils/release/github-upload-release.py
+           llvm/utils/git/requirements.txt
+        sparse-checkout-cone-mode: false
 
     - name: Install Python Requirements
       if: inputs.upload == 'true'



More information about the llvm-commits mailing list