From 7349cab150a9e26a6d474afb697c6f285946302e Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 27 Aug 2026 20:38:32 +0000 Subject: [PATCH] fix: enable GitHub Pages from pkgdown workflow Site content already deploys to gh-pages, but Pages was never enabled (has_pages=false), so the hosted URL 404s. Grant pages:write and POST the Pages source so deploy can publish the live site. Co-authored-by: bbuchsbaum --- .github/workflows/pkgdown.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index c5858ca..0fe5c6f 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -23,6 +23,7 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} permissions: contents: write + pages: write steps: - uses: actions/checkout@v4 @@ -41,6 +42,16 @@ jobs: run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) shell: Rscript {0} + - name: Enable GitHub Pages + if: github.event_name != 'pull_request' + run: | + gh api repos/${{ github.repository }}/pages \ + --method POST --input - <<'EOF' || true + {"source":{"branch":"gh-pages","path":"/"}} + EOF + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Deploy to GitHub pages if: github.event_name != 'pull_request' uses: JamesIves/github-pages-deploy-action@v4.7.3