From b82568f61199eee8ee91e886332af7fa9e81fcd4 Mon Sep 17 00:00:00 2001 From: Dennis Park Date: Mon, 3 Aug 2026 13:20:12 +0900 Subject: [PATCH] fix: let the docs workflow write into the Jekyll output actions/jekyll-build-pages runs in a container as root, so _site comes back owned by root and the step that drops the API reference into it failed with "Permission denied". The workflow also only ran on the default branch, which meant a site that no longer builds could only be discovered after merging. It now builds on pull requests too, and deploys only when the event is not one. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/docs.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a5f5d73..8c2e9e0 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -17,6 +17,16 @@ on: - 'README.md' - '_config.yml' - '.github/workflows/docs.yml' + # Build on pull requests as well - without deploying - so a site that no + # longer builds is caught before it reaches the default branch. + pull_request: + branches: [ main, master ] + paths: + - 'src/libcmutils.h' + - 'doc/**' + - 'README.md' + - '_config.yml' + - '.github/workflows/docs.yml' workflow_dispatch: permissions: @@ -65,8 +75,11 @@ jobs: fi echo "doxygen reported no documentation problems" + # jekyll-build-pages runs in a container as root, so _site comes back + # owned by root: take it over before writing into it or packing it. - name: Place the reference under /api run: | + sudo chown -R "$(id -u):$(id -g)" _site mkdir -p _site/api cp -r doc/html/. _site/api/ @@ -77,6 +90,7 @@ jobs: deploy: name: Deploy to Pages needs: build + if: github.event_name != 'pull_request' runs-on: ubuntu-latest environment: name: github-pages