feat: add dry run option to documentation publishing workflows and ne…#75
Conversation
…w task for building documentation Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Pull request overview
Adds a “dry run” mode to the documentation publishing GitHub Actions workflows and introduces a new VS Code task to build + generate docs locally.
Changes:
- Add
workflow_dispatch+dry_runinput to docs-sync workflow and gategit pushon dry-run. - Add
dry_runinput to docs publishing workflow and gategit pushon dry-run. - Add a new VS Code task to run build + doc generation tasks in one command.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.vscode/tasks.json |
Adds a task to run build,updateHelp,publishDocs via DevOps/Build/build.ps1. |
.github/workflows/sync-development-docs.yml |
Enables manual dispatch with dry_run and skips the final push when enabled. |
.github/workflows/publish-docs.yml |
Adds dry_run input and skips the final push when enabled. |
| if ('${{ inputs.dry_run }}' -eq 'true') { | ||
| Write-Host 'Dry run: skipping git push.' -ForegroundColor Yellow | ||
| } else { | ||
| git push origin "HEAD:$targetBranch" | ||
| } |
There was a problem hiding this comment.
dry_run currently only skips the final git push, but this job still performs a git push --dry-run permission check earlier in the script. That means “dry run” will still fail unless DOCS_REPO_TOKEN has push rights, which undermines the intent of a test mode. Consider bypassing the push permission check (and any other push-only prerequisites) when inputs.dry_run is true, or clearly rename/reword the option to indicate it only skips the actual push.
| @@ -20,14 +27,17 @@ jobs: | |||
| env: | |||
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |||
| if: >- | |||
| github.event.workflow_run.conclusion == 'success' && | |||
| github.event.workflow_run.event == 'push' && | |||
| github.event.workflow_run.head_branch == 'develop' | |||
| github.event_name == 'workflow_dispatch' || | |||
| ( | |||
| github.event.workflow_run.conclusion == 'success' && | |||
| github.event.workflow_run.event == 'push' && | |||
| github.event.workflow_run.head_branch == 'develop' | |||
| ) | |||
There was a problem hiding this comment.
Allowing workflow_dispatch means this workflow can be run from any ref selected in the UI, but the workflow always commits with the message “Sync … from develop” and doesn’t validate that the checked-out ref is actually develop. To avoid accidentally syncing docs from a feature branch (or producing misleading commit history), consider restricting manual runs to develop (e.g., branch check in the job if: or in-script validation) or updating the commit message to reflect the actual source ref/SHA.
| if ('${{ inputs.dry_run }}' -eq 'true') { | ||
| Write-Host 'Dry run: skipping git push.' -ForegroundColor Yellow | ||
| } else { | ||
| git push origin "HEAD:$targetBranch" | ||
| } |
There was a problem hiding this comment.
dry_run only skips the final git push, but the script still executes a git push --dry-run permission check earlier. As a result, “dry run” will still fail unless DOCS_REPO_TOKEN can push to the docs repo, which limits its usefulness for test runs. Consider skipping the push permission check when inputs.dry_run is true, or adjust the input description to clarify that push permissions are still required.
…w task for building documentation