From 84d351e96aaa2a1338006d6e7221eded161f517b Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Fri, 9 Aug 2024 08:48:31 -0500 Subject: [PATCH] Merge commit from fork --- .github/workflows/ci.yml | 5 ++--- .github/workflows/docs-preview.yml | 10 ++++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3fe9a7978..8505f5972e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -235,9 +235,8 @@ jobs: run: pdm run make docs-linkcheck - name: Save PR number - env: - PR_NUMBER: ${{ github.event.number }} - run: echo $PR_NUMBER > .pr_number + run: | + echo "${{ github.event.number }}" > .pr_number - name: Upload artifact uses: actions/upload-artifact@v3 diff --git a/.github/workflows/docs-preview.yml b/.github/workflows/docs-preview.yml index 38d7345aba..7ccb6c6fb2 100644 --- a/.github/workflows/docs-preview.yml +++ b/.github/workflows/docs-preview.yml @@ -24,8 +24,14 @@ jobs: path: docs-preview name: docs-preview - - name: Set PR number - run: echo "PR_NUMBER=$(cat docs-preview/.pr_number)" >> $GITHUB_ENV + - name: Validate and set PR number + run: | + PR_NUMBER=$(cat docs-preview/.pr_number) + if ! [[ "$PR_NUMBER" =~ ^[0-9]+$ ]]; then + echo "Invalid PR number: $PR_NUMBER" + exit 1 + fi + echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV - name: Deploy docs preview uses: JamesIves/github-pages-deploy-action@v4