-
-
Notifications
You must be signed in to change notification settings - Fork 52
feat: add dry run option to documentation publishing workflows and ne… #75
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,13 @@ on: | |
| workflows: ['CI'] | ||
| types: | ||
| - completed | ||
| workflow_dispatch: | ||
| inputs: | ||
| dry_run: | ||
| description: Skip the git push to homotechsualdocs (test mode) | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
|
|
||
| permissions: | ||
| actions: read | ||
|
|
@@ -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' | ||
| ) | ||
|
Comment on lines
11
to
+35
|
||
| steps: | ||
| - name: Checkout HaloAPI repository | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ github.event.workflow_run.head_sha }} | ||
| ref: ${{ github.event.workflow_run.head_sha || github.sha }} | ||
|
|
||
| - name: Clone and update homotechsualdocs | ||
| shell: pwsh | ||
|
|
@@ -85,7 +95,11 @@ jobs: | |
|
|
||
| git add docs/haloapi/development | ||
| git commit -m 'Sync HaloAPI development docs from develop' | ||
| git push origin "HEAD:$targetBranch" | ||
| if ('${{ inputs.dry_run }}' -eq 'true') { | ||
| Write-Host 'Dry run: skipping git push.' -ForegroundColor Yellow | ||
| } else { | ||
| git push origin "HEAD:$targetBranch" | ||
| } | ||
|
Comment on lines
+98
to
+102
|
||
| } finally { | ||
| Pop-Location | ||
| } | ||
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.
dry_runonly skips the finalgit push, but the script still executes agit push --dry-runpermission check earlier. As a result, “dry run” will still fail unlessDOCS_REPO_TOKENcan push to the docs repo, which limits its usefulness for test runs. Consider skipping the push permission check wheninputs.dry_runis true, or adjust the input description to clarify that push permissions are still required.