From 49b9d6a58460aaeda03f5765abc7a704d85a873a Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Fri, 18 Jul 2025 15:31:52 +0800 Subject: [PATCH] fix(ci): cannot run doc preview for PR from forked repo --- .github/workflows/ci.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84b9b582c4..41e5a77fae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,17 +28,13 @@ jobs: - name: Build HTML Docs run: VERSION=${{ github.event.repository.default_branch }} JOBS=4 MODE=html make all - - uses: actions/create-github-app-token@v2 - id: app-token - with: - app-id: ${{ secrets.APP_ID }} - private-key: ${{ secrets.APP_PRIVATE_KEY }} - - name: Deploy PR Doc Preview + # PR from the forked repo would be denied as the permission is not granted. + # Allow only PR from this repo. + if: ${{ ( github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name ) }} uses: rossjrw/pr-preview-action@v1 with: source-dir: ../cpython/Doc/build/html - token: ${{ steps.app-token.outputs.token }} preview-branch: gh-pages umbrella-dir: pr-preview action: auto