From 07c387afc1a4a91821823a2d6fb797f431dc636e Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Tue, 19 May 2026 19:40:34 +0200 Subject: [PATCH] ci: skip x16-docs PDF fetch on fork PRs The "Fetch x16-docs PDFs" step uses gh run download to pull artifacts from the X16Community/x16-docs repo. On pull requests from forks, the default GITHUB_TOKEN has restricted read-only permissions and cannot access other repositories, causing the build to fail. Add a condition to skip this step when the PR originates from a fork. --- .github/workflows/build.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b9420d1..7d287e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -108,6 +108,7 @@ jobs: name: readme-pdf path: emu_binaries - name: Fetch x16-docs PDFs + if: github.event.pull_request.head.repo.fork == false run: gh run download -R X16Community/x16-docs -n x16-docs-pdf --dir emu_binaries shell: cmd env: @@ -197,6 +198,7 @@ jobs: name: readme-pdf path: emu_binaries - name: Fetch x16-docs PDFs + if: github.event.pull_request.head.repo.fork == false run: gh run download -R X16Community/x16-docs -n x16-docs-pdf --dir emu_binaries env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -257,6 +259,7 @@ jobs: name: readme-pdf path: emu_binaries - name: Fetch x16-docs PDFs + if: github.event.pull_request.head.repo.fork == false run: gh run download -R X16Community/x16-docs -n x16-docs-pdf --dir emu_binaries env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -322,6 +325,7 @@ jobs: name: readme-pdf path: emu_binaries - name: Fetch x16-docs PDFs + if: github.event.pull_request.head.repo.fork == false run: gh run download -R X16Community/x16-docs -n x16-docs-pdf --dir emu_binaries env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -387,6 +391,7 @@ jobs: name: readme-pdf path: emu_binaries - name: Fetch x16-docs PDFs + if: github.event.pull_request.head.repo.fork == false run: gh run download -R X16Community/x16-docs -n x16-docs-pdf --dir emu_binaries env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -443,6 +448,7 @@ jobs: name: readme-pdf path: emu_binaries - name: Fetch x16-docs PDFs + if: github.event.pull_request.head.repo.fork == false run: gh run download -R X16Community/x16-docs -n x16-docs-pdf --dir emu_binaries env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -498,6 +504,7 @@ jobs: name: readme-pdf path: emu_binaries - name: Fetch x16-docs PDFs + if: github.event.pull_request.head.repo.fork == false run: gh run download -R X16Community/x16-docs -n x16-docs-pdf --dir emu_binaries env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}