diff --git a/.github/actions/doc_preview/action.yml b/.github/actions/doc_preview/action.yml index 7ece4061ea..bc7cc4d923 100644 --- a/.github/actions/doc_preview/action.yml +++ b/.github/actions/doc_preview/action.yml @@ -21,9 +21,9 @@ runs: using: composite steps: # The steps below are executed only when testing in a PR. - # Note: the PR previews will be removed once merged to main (see below) + # Note: the PR previews will be removed once merged to main or release/* (see below) - name: Deploy doc preview - if: ${{ github.ref_name != 'main' }} + if: ${{ github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }} uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4.7.3 with: git-config-name: cuda-python-bot @@ -33,7 +33,7 @@ runs: commit-message: "Deploy doc preview for PR ${{ inputs.pr-number }} (${{ github.sha }})" - name: Leave a comment after deployment - if: ${{ github.ref_name != 'main' }} + if: ${{ github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }} uses: marocchino/sticky-pull-request-comment@67d0dec7b07ed060a405f9b2a64b8ab319fdd7db # v2.9.2 with: header: pr-preview @@ -48,9 +48,9 @@ runs: |
https://nvidia.github.io/cuda-python/pr-preview/pr-${{ inputs.pr-number }}/cuda-pathfinder/

|

Preview will be ready when the GitHub Pages deployment is complete.

- # The steps below are executed only when building on main. + # The steps below are executed only when building on main or release/*. - name: Remove doc preview - if: ${{ github.ref_name == 'main' }} + if: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release/') }} uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4.7.3 with: git-config-name: cuda-python-bot @@ -60,7 +60,7 @@ runs: commit-message: "Clean up doc preview for PR ${{ inputs.pr-number }} (${{ github.sha }})" - name: Leave a comment after removal - if: ${{ github.ref_name == 'main' }} + if: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release/') }} uses: marocchino/sticky-pull-request-comment@67d0dec7b07ed060a405f9b2a64b8ab319fdd7db # v2.9.2 with: header: pr-preview diff --git a/.github/actions/get_pr_number/action.yml b/.github/actions/get_pr_number/action.yml index fc8420ebdd..1641f80684 100644 --- a/.github/actions/get_pr_number/action.yml +++ b/.github/actions/get_pr_number/action.yml @@ -9,13 +9,13 @@ description: Get the PR number without relying on the pull_request* event trigge runs: using: composite steps: - - name: Get PR info (non-main branch) - if: ${{ github.ref_name != 'main' }} + - name: Get PR info (non-main, non-release branch) + if: ${{ github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }} uses: nv-gha-runners/get-pr-info@main id: get-pr-info - - name: Extract PR number (non-main branch) - if: ${{ github.ref_name != 'main' }} + - name: Extract PR number (non-main, non-release branch) + if: ${{ github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }} shell: bash --noprofile --norc -xeuo pipefail {0} run: | trap 'echo "Error at line $LINENO"; exit 1' ERR @@ -27,8 +27,8 @@ runs: echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV echo "BUILD_PREVIEW=1" >> $GITHUB_ENV - - name: Get PR data (main branch) - if: ${{ github.ref_name == 'main' }} + - name: Get PR data (main or release/* branch) + if: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release/') }} uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 id: get-pr-data with: @@ -39,19 +39,19 @@ runs: repo: context.repo.repo, }); if (!prs.data.length) { - core.setFailed("No PR associated with this commit on 'main'."); + core.setFailed("No PR associated with this commit on 'main' or 'release/*'."); } else { return prs.data[0]; } - - name: Extract PR number (main branch) - if: ${{ github.ref_name == 'main' }} + - name: Extract PR number (main or release/* branch) + if: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release/') }} shell: bash --noprofile --norc -xeuo pipefail {0} run: | trap 'echo "Error at line $LINENO"; exit 1' ERR PR_NUMBER="${{ fromJSON(steps.get-pr-data.outputs.result).number }}" if [[ -z "$PR_NUMBER" ]]; then - echo "No associated PR found for the commit in 'main'." + echo "No associated PR found for the commit in 'main' or 'release/*'." exit 1 fi echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV