Repository navigation
Propose documentation updates after code merges to main #1225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dhruv8sh
wants to merge
18
commits into
main
Choose a base branch
from
feat/docs-proposal-automation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
12f1bd9
Add documentation proposal automation design and plan
dhruv8sh f70ce72
Propose documentation updates after code merges to main
dhruv8sh f22e366
Isolate documentation proposal builds from publication credentials
dhruv8sh ae8d9c5
Merge branch 'main' into feat/docs-proposal-automation
prk-Jr e26af27
Keep maintainer commits on proposal branches across retries
dhruv8sh 8ce9d08
Stop allowing Copilot to run git grep
dhruv8sh d0710fe
Drop the npm cache from jobs that run untrusted content
dhruv8sh 5c3fd10
Bound documentation proposal jobs with timeouts
dhruv8sh 17a0938
Neutralize mentions in the proposal rationale
dhruv8sh f9f47ee
Refuse proposal retries that inspect a different range
dhruv8sh 947cf4c
Document the proposal scripts CI gate and first-run prerequisites
dhruv8sh 2304a9a
Fill the proposal work directory into Copilot prompts
dhruv8sh b3e3b22
Merge remote-tracking branch 'origin/main' into feat/docs-proposal-au…
dhruv8sh 0bc4bf7
Guard empty-rerun branch deletion with a lease
dhruv8sh a7ad11d
Harden documentation proposals against forks, symlinks, and live rati…
dhruv8sh 5e54ade
Merge remote-tracking branch 'origin/main' into feat/docs-proposal-au…
dhruv8sh a40b319
Merge branch 'main' into feat/docs-proposal-automation
prk-Jr c3a33e6
Merge branch 'main' into feat/docs-proposal-automation
aram356 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,187 @@ | ||
| name: Documentation proposal | ||
|
|
||
| # Proposes documentation edits with Copilot CLI after code merges to main and | ||
| # opens one reviewable pull request per merge. See | ||
| # docs/superpowers/specs/2026-10-01-docs-proposal-automation-design.md. | ||
| on: | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - "crates/**" | ||
| - "trusted-server.example.toml" | ||
| - "edgezero.toml" | ||
| - "fastly.toml" | ||
| - ".cargo/config.toml" | ||
| - "scripts/**" | ||
| - "!scripts/docs-proposal/**" | ||
| workflow_dispatch: | ||
| inputs: | ||
| sha: | ||
| description: Full SHA of a commit on main to propose documentation for | ||
| required: true | ||
| type: string | ||
| base: | ||
| description: >- | ||
| Full SHA of main before the push that added the commit, when that | ||
| push added several commits; defaults to the commit's first parent | ||
| required: false | ||
| type: string | ||
|
|
||
| permissions: {} | ||
|
|
||
| # Sequential merges are proposed one at a time, in order. The default queue | ||
| # keeps only one pending run and cancels older ones, so keep them all. Every | ||
| # job has a timeout so a hung run cannot hold the queue for hours. | ||
| concurrency: | ||
| group: docs-proposal | ||
| cancel-in-progress: false | ||
|
dhruv8sh marked this conversation as resolved.
|
||
| queue: max | ||
|
|
||
| # Each job runs the proposal scripts from the workflow's own revision in | ||
| # `tools/` against a checkout of the merge commit in `source/`, so retrying a | ||
| # merge that predates this tooling, or a later fix to it, still works. A push | ||
| # that adds several commits is inspected from the previous main head; a manual | ||
| # retry of such a push needs that head as its `base` input. | ||
| env: | ||
| MERGE_SHA: ${{ inputs.sha || github.sha }} | ||
| BASE_SHA: ${{ github.event_name == 'push' && github.event.before || inputs.base }} | ||
|
|
||
| jobs: | ||
| # Copilot runs here with a read-only token; it cannot push or open PRs. | ||
| # Copilot can write files that later steps execute, so treat this job as | ||
| # untrusted: it uses no dependency cache that later runs would restore. | ||
| propose: | ||
| runs-on: ubuntu-latest | ||
|
dhruv8sh marked this conversation as resolved.
|
||
| timeout-minutes: 30 | ||
| permissions: | ||
| contents: read | ||
| copilot-requests: write | ||
| steps: | ||
| - name: Checkout tools | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.workflow_sha }} | ||
| path: tools | ||
| persist-credentials: false | ||
|
|
||
| - name: Checkout merge commit | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ env.MERGE_SHA }} | ||
|
dhruv8sh marked this conversation as resolved.
|
||
| path: source | ||
| fetch-depth: 0 | ||
| persist-credentials: false | ||
|
|
||
| - name: Retrieve Node.js version | ||
| id: node-version | ||
| run: echo "node-version=$(grep '^nodejs ' tools/.tool-versions | awk '{print $2}')" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ steps.node-version.outputs.node-version }} | ||
|
|
||
| - name: Install Copilot CLI | ||
| run: npm install -g @github/copilot@1.0.90 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Low: Only the top-level package is pinned; |
||
|
|
||
| - name: Propose documentation edits | ||
| working-directory: source | ||
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| run: ../tools/scripts/docs-proposal/propose.sh "$MERGE_SHA" .docs-proposal "$BASE_SHA" | ||
|
|
||
| - name: Upload proposal | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: docs-proposal | ||
| path: source/.docs-proposal/ | ||
| include-hidden-files: true | ||
| if-no-files-found: error | ||
|
|
||
| # VitePress executes Vue in Markdown during the build, so the docs gates run | ||
| # here with no write token, persisted credentials, or dependency cache. | ||
| validate: | ||
| needs: propose | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - name: Checkout tools | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.workflow_sha }} | ||
| path: tools | ||
| persist-credentials: false | ||
|
|
||
| - name: Checkout merge commit | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ env.MERGE_SHA }} | ||
| path: source | ||
| fetch-depth: 0 | ||
| persist-credentials: false | ||
|
|
||
| - name: Retrieve Node.js version | ||
| id: node-version | ||
| run: echo "node-version=$(grep '^nodejs ' tools/.tool-versions | awk '{print $2}')" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ steps.node-version.outputs.node-version }} | ||
|
|
||
| - name: Download proposal | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: docs-proposal | ||
| path: source/.docs-proposal | ||
|
|
||
| - name: Validate proposal | ||
| working-directory: source | ||
| run: ../tools/scripts/docs-proposal/validate.sh "$MERGE_SHA" .docs-proposal | ||
|
|
||
| # Copilot does not run here, and neither does any proposal content: this job | ||
| # re-checks the path allowlist on a fresh checkout and publishes the patch. | ||
| publish: | ||
| needs: validate | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| steps: | ||
| - name: Checkout tools | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.workflow_sha }} | ||
| path: tools | ||
| persist-credentials: false | ||
|
|
||
| - name: Checkout merge commit | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ env.MERGE_SHA }} | ||
| path: source | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Retrieve Node.js version | ||
| id: node-version | ||
| run: echo "node-version=$(grep '^nodejs ' tools/.tool-versions | awk '{print $2}')" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ steps.node-version.outputs.node-version }} | ||
|
|
||
| - name: Download proposal | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: docs-proposal | ||
| path: source/.docs-proposal | ||
|
|
||
| - name: Publish proposal pull request | ||
| working-directory: source | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: ../tools/scripts/docs-proposal/publish.sh "$MERGE_SHA" .docs-proposal | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Low: Untrusted code in
propose/validateruns on themainref, so it can still poison other main-scoped caches (rust-cache and npm intest.yml/format.yml, restored by every PR). Those have read-only tokens and no secrets, so the impact is CI integrity only today. A future privileged workflow that adds a cache would be exposed, though. Consider a note indocs-proposal.ymlor the design doc saying privileged workflows must not restore caches.