[llvm] workflows/upload-release-artifact: Use require-release-manager action (PR #195374)
via llvm-commits
llvm-commits at lists.llvm.org
Fri May 1 15:54:49 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-github-workflow
Author: Tom Stellard (tstellar)
<details>
<summary>Changes</summary>
This removes the final use of RELEASE_TASKS_USER_TOKEN secret. It required plumbing the secrets in thrugh several levels of workflow calls, which is not ideal, but I don't see a better way to do this.
---
Full diff: https://github.com/llvm/llvm-project/pull/195374.diff
5 Files Affected:
- (modified) .github/workflows/release-binaries-all.yml (+6-3)
- (modified) .github/workflows/release-binaries.yml (+2-1)
- (modified) .github/workflows/release-sources.yml (+11-3)
- (modified) .github/workflows/release-tasks.yml (+4-2)
- (modified) .github/workflows/upload-release-artifact/action.yml (+12-12)
``````````diff
diff --git a/.github/workflows/release-binaries-all.yml b/.github/workflows/release-binaries-all.yml
index d331d2699f4cb..dfdb159cff50d 100644
--- a/.github/workflows/release-binaries-all.yml
+++ b/.github/workflows/release-binaries-all.yml
@@ -30,9 +30,12 @@ on:
default: false
type: boolean
secrets:
- RELEASE_TASKS_USER_TOKEN:
- description: "Secret used to check user permissions."
- required: false
+ LLVM_TOKEN_GENERATOR_CLIENT_ID:
+ description: "Client ID for our GitHub App we use for generating access tokens."
+ required: true
+ LLVM_TOKEN_GENERATOR_PRIVATE_KEY:
+ description: "Private key for our GitHub App we use for generating access tokens."
+ required: true
pull_request:
types:
diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml
index 6585464d94936..64f162f1777a8 100644
--- a/.github/workflows/release-binaries.yml
+++ b/.github/workflows/release-binaries.yml
@@ -358,4 +358,5 @@ jobs:
attestation-name: ${{ needs.prepare.outputs.attestation-name }}
digest: ${{ needs.build-release-package.outputs.digest }}
upload: ${{ needs.prepare.outputs.upload }}
- user-token: ${{ secrets.RELEASE_TASKS_USER_TOKEN }}
+ LLVM_TOKEN_GENERATOR_CLIENT_ID: ${{ secrets.LLVM_TOKEN_GENERATOR_CLIENT_ID }}
+ LLVM_TOKEN_GENERATOR_PRIVATE_KEY: ${{ secrets.LLVM_TOKEN_GENERATOR_PRIVATE_KEY }}
diff --git a/.github/workflows/release-sources.yml b/.github/workflows/release-sources.yml
index 5192c19b8a1e4..d3ad5b67927c3 100644
--- a/.github/workflows/release-sources.yml
+++ b/.github/workflows/release-sources.yml
@@ -17,9 +17,12 @@ on:
required: true
type: string
secrets:
- RELEASE_TASKS_USER_TOKEN:
- description: "Secret used to check user permissions."
- required: false
+ LLVM_TOKEN_GENERATOR_CLIENT_ID:
+ description: "Client ID for our GitHub App we use for generating access tokens."
+ required: true
+ LLVM_TOKEN_GENERATOR_PRIVATE_KEY:
+ description: "Private key for our GitHub App we use for generating access tokens."
+ required: true
# Run on pull_requests for testing purposes.
pull_request:
paths:
@@ -101,6 +104,9 @@ jobs:
attest-release-sources:
name: Attest Release Sources
runs-on: ubuntu-24.04
+ environment:
+ deployment: false
+ name: release
if: github.event_name != 'pull_request'
needs:
- inputs
@@ -126,3 +132,5 @@ jobs:
attestation-name: ${{ needs.inputs.outputs.ref }}-sources-attestation
digest: ${{ needs.release-sources.outputs.digest }}
upload: false
+ LLVM_TOKEN_GENERATOR_CLIENT_ID: ${{ secrets.LLVM_TOKEN_GENERATOR_CLIENT_ID }}
+ LLVM_TOKEN_GENERATOR_PRIVATE_KEY: ${{ secrets.LLVM_TOKEN_GENERATOR_PRIVATE_KEY }}
diff --git a/.github/workflows/release-tasks.yml b/.github/workflows/release-tasks.yml
index aa07604d96d40..02c4a4ec3aab0 100644
--- a/.github/workflows/release-tasks.yml
+++ b/.github/workflows/release-tasks.yml
@@ -170,7 +170,8 @@ jobs:
upload: true
# Called workflows don't have access to secrets by default, so we need to explicitly pass secrets that we use.
secrets:
- RELEASE_TASKS_USER_TOKEN: ${{ secrets.RELEASE_TASKS_USER_TOKEN }}
+ LLVM_TOKEN_GENERATOR_CLIENT_ID: ${{ secrets.LLVM_TOKEN_GENERATOR_CLIENT_ID }}
+ LLVM_TOKEN_GENERATOR_PRIVATE_KEY: ${{ secrets.LLVM_TOKEN_GENERATOR_PRIVATE_KEY }}
release-sources:
name: Package Release Sources
@@ -185,7 +186,8 @@ jobs:
release-version: ${{ needs.validate-tag.outputs.release-version }}
# Called workflows don't have access to secrets by default, so we need to explicitly pass secrets that we use.
secrets:
- RELEASE_TASKS_USER_TOKEN: ${{ secrets.RELEASE_TASKS_USER_TOKEN }}
+ LLVM_TOKEN_GENERATOR_CLIENT_ID: ${{ secrets.LLVM_TOKEN_GENERATOR_CLIENT_ID }}
+ LLVM_TOKEN_GENERATOR_PRIVATE_KEY: ${{ secrets.LLVM_TOKEN_GENERATOR_PRIVATE_KEY }}
uncomment-download-links:
name: Uncomment download links
diff --git a/.github/workflows/upload-release-artifact/action.yml b/.github/workflows/upload-release-artifact/action.yml
index d8e0704c7c53f..5654976936af1 100644
--- a/.github/workflows/upload-release-artifact/action.yml
+++ b/.github/workflows/upload-release-artifact/action.yml
@@ -14,12 +14,6 @@ inputs:
but no atteastion will be generated and the artifact won't be uploaded
to the release.
default: true
- user-token:
- description: >-
- Token with premissions to read llvm teams that is used to ensure that
- the person who triggred the action has permission to upload artifacts.
- This is required if upload is true.
- required: false
attestation-name:
description: >-
This will be used for the artifact name that is attached to the workflow and
@@ -35,6 +29,14 @@ inputs:
description: >-
sha256 digest to verify the authenticity of the files being uploaded.
required: true
+ LLVM_TOKEN_GENERATOR_CLIENT_ID:
+ description: >-
+ Client ID for our GitHub App we use for generating access tokens.
+ required: true
+ LLVM_TOKEN_GENERATOR_PRIVATE_KEY:
+ description: >-
+ Private key for our GitHub App we use for generating access tokens.
+ required: true
runs:
using: "composite"
@@ -92,12 +94,10 @@ runs:
- name: Check Permissions
if: inputs.upload == 'true'
- env:
- GITHUB_TOKEN: ${{ github.token }}
- USER_TOKEN: ${{ inputs.user-token }}
- shell: bash
- run: |
- ./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --user "$GITHUB_ACTOR" --user-token "$USER_TOKEN" check-permissions
+ uses: ./.github/workflows/require-release-manager
+ with:
+ LLVM_TOKEN_GENERATOR_CLIENT_ID: ${{ inputs.LLVM_TOKEN_GENERATOR_CLIENT_ID }}
+ LLVM_TOKEN_GENERATOR_PRIVATE_KEY: ${{ inputs.LLVM_TOKEN_GENERATOR_PRIVATE_KEY }}
- name: Upload Release
shell: bash
if: inputs.upload == 'true'
``````````
</details>
https://github.com/llvm/llvm-project/pull/195374
More information about the llvm-commits
mailing list