Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/actions/doc_preview/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -48,9 +48,9 @@ runs:
| <br> https://nvidia.github.io/cuda-python/pr-preview/pr-${{ inputs.pr-number }}/cuda-pathfinder/ <br><br>
| <h6><br> Preview will be ready when the GitHub Pages deployment is complete. <br><br></h6>

# 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
Expand All @@ -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
Expand Down
20 changes: 10 additions & 10 deletions .github/actions/get_pr_number/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand Down
Loading