Skip to content

workflows/release-documentation: Rework workflow to make it testable - #212689

Draft
tstellar wants to merge 1 commit into
llvm:mainfrom
tstellar:release-docs-testing
Draft

workflows/release-documentation: Rework workflow to make it testable#212689
tstellar wants to merge 1 commit into
llvm:mainfrom
tstellar:release-docs-testing

Conversation

@tstellar

Copy link
Copy Markdown
Contributor

Removed the environment declaration from the validation job and split out the www-releases update into a separate job. This makes it safe and possible to add a pull_request trigger so we can at least test building the documentation when someone submits a pull request.

Removed the environment declaration from the validation job and split
out the www-releases update into a separate job.  This makes it safe
and possible to add a pull_request trigger so we can at least test
building the documentation when someone submits a pull request.
@llvmorg-github-actions

Copy link
Copy Markdown

@llvm/pr-subscribers-github-workflow

Author: Tom Stellard (tstellar)

Changes

Removed the environment declaration from the validation job and split out the www-releases update into a separate job. This makes it safe and possible to add a pull_request trigger so we can at least test building the documentation when someone submits a pull request.


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

1 Files Affected:

  • (modified) .github/workflows/release-documentation.yml (+34-14)
diff --git a/.github/workflows/release-documentation.yml b/.github/workflows/release-documentation.yml
index a39d4dba87a5a..6ee08cb48a95f 100644
--- a/.github/workflows/release-documentation.yml
+++ b/.github/workflows/release-documentation.yml
@@ -38,6 +38,24 @@ on:
       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:
+      - '.github/workflows/release-documentation.yml'
+      - 'llvm/utils/release/build-docs.sh'
+    types:
+      - opened
+      - synchronize
+      - reopened
+      # When a PR is closed, we still start this workflow, but then skip
+      # all the jobs, which makes it effectively a no-op.  The reason to
+      # do this is that it allows us to take advantage of concurrency groups
+      # to cancel in progress CI jobs whenever the PR is closed.
+      - closed
+
+concurrency:
+  group: ${{ github.workflow }}-${{ inputs.release-version || github.event.pull_request.number }}
+  cancel-in-progress: True
 
 jobs:
   # This job checks permissions and validates inputs to prevent potential
@@ -47,9 +65,6 @@ jobs:
   release-man-pages-validate-input:
     name: Release Man Pages Validate Input
     runs-on: ubuntu-24.04
-    environment:
-      name: release
-      deployment: false
     permissions:
       contents: read
     steps:
@@ -59,13 +74,6 @@ jobs:
           sparse-checkout: |
             .github/workflows/
 
-      - name: Check Permissions
-        uses: ./.github/workflows/require-team-membership
-        with:
-          team-slug: llvm-release-managers
-          LLVM_TOKEN_GENERATOR_CLIENT_ID: ${{ secrets.LLVM_TOKEN_GENERATOR_CLIENT_ID }}
-          LLVM_TOKEN_GENERATOR_PRIVATE_KEY: ${{ secrets.LLVM_TOKEN_GENERATOR_PRIVATE_KEY }}
-
       - name: Validate Input
         uses: ./.github/workflows/validate-release-version
         with:
@@ -84,8 +92,6 @@ jobs:
       man-page-tarball-name: ${{ steps.vars.outputs.man-page-tarball-name }}
       man-page-upload: ${{ steps.vars.outputs.man-page-upload }}
       man-page-attestation-name: ${{ steps.vars.outputs.man-page-attestation-name }}
-    env:
-      upload: ${{ inputs.upload && !contains(inputs.release-version, 'rc') }}
     steps:
       - name: Collect Variables
         id: vars
@@ -155,8 +161,23 @@ jobs:
           name: release-notes
           path: docs-build/html-export/
 
+
+  upload-release-notes:
+    name: "Upload Release Notes"
+    runs-on: ubuntu-24.04
+    environment:
+      deployment: false
+      name: release
+    needs:
+      - release-documentation
+    if: >-
+      github.event_name != 'pull_request' &&
+      inputs.upload &&
+      !contains(inputs.release-version, 'rc')
+    permissions:
+      contents: read
+    steps:
       - name: Clone www-releases
-        if: env.upload
         uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
         with:
           repository: ${{ github.repository_owner }}/www-releases
@@ -166,7 +187,6 @@ jobs:
           persist-credentials: false
 
       - name: Upload Release Notes
-        if: env.upload
         env:
           PUSH_TOKEN: ${{ secrets.LLVMBOT_WWW_RELEASES_PUSH }}
           GH_TOKEN: ${{ secrets.WWW_RELEASES_TOKEN }}

@tstellar
tstellar marked this pull request as draft July 29, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant