Skip to content

feat: Secure docs + docs publish workflows - #158

Closed
lurtz wants to merge 17 commits into
mainfrom
secure-docs
Closed

feat: Secure docs + docs publish workflows#158
lurtz wants to merge 17 commits into
mainfrom
secure-docs

Conversation

@lurtz

@lurtz lurtz commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Full rewrite and split of docs workflow. The more dangerous build actions are now run in less privileged contexts. Only uploading artifacts and posting a comment needs more privileges which is now moved into a separate workflow which does not run attacker code.

Proven in use at

Ported #124 to current main branch and use up to date actions/checkout.

@lurtz lurtz changed the title Secure docs feat: Secure docs Jul 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR ports and modernizes the documentation publishing approach by separating the docs build (artifact creation) from the GitHub Pages deployment, and updating action pins (notably actions/checkout) to newer revisions.

Changes:

  • Simplifies the reusable docs build workflow to only build docs via Bazel and upload _build as the github-pages artifact.
  • Introduces a new reusable workflow to publish the github-pages artifact to gh-pages, maintain versions.json, and optionally comment a preview link on PRs.
  • Removes the legacy composite action for versioned Pages deployment.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
.github/workflows/docs.yml Streamlines docs build to always run bazel run //:docs and upload _build as a single, stable artifact name (github-pages).
.github/workflows/docs-publish.yml Adds a reusable workflow intended to deploy docs artifacts to gh-pages and GitHub Pages, including versions tracking and PR preview commenting.
.github/actions/deploy-versioned-pages/action.yml Removes the deprecated composite action previously used for versioned Pages deployment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/docs-publish.yml
Comment thread .github/workflows/docs-publish.yml Outdated
Comment thread .github/workflows/docs-publish.yml
Comment thread .github/workflows/docs-publish.yml
Comment thread .github/workflows/docs-publish.yml
Comment thread .github/workflows/docs-publish.yml Outdated
@lurtz
lurtz marked this pull request as ready for review July 24, 2026 20:04
@lurtz lurtz changed the title feat: Secure docs feat: Secure docs + docs publish workflows Jul 24, 2026
Comment thread .github/workflows/docs-publish.yml Outdated
id: metadata
run: |
EVENT_NAME="${{ github.event.workflow_run.event }}"
PR_NUMBER="${{ github.event.workflow_run.pull_requests[0].number }}"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not seem to work. This pull request got no comment:

The associated workflow run did not get a pull request number:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idea: docs workflow writes metadata file containing pull request number into artifacts. Then this metadata is used in the docs publish workflow

@lurtz
lurtz marked this pull request as draft July 24, 2026 21:23

@AlexanderLanin AlexanderLanin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a significant improvement over the original #124, but its not ready yet unfortunately

@AlexanderLanin

Copy link
Copy Markdown
Member

commits taken over to #124 with a force push. closing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants