Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ on:
description: Release tag associated with the documentation, for example v1.23.0
required: true
type: string
dry_run:
description: Skip the git push to homotechsualdocs (test mode)
required: false
default: false
type: boolean

permissions:
actions: read
Expand Down Expand Up @@ -174,7 +179,11 @@ jobs:

git add -- $pathsToAdd
git commit -m "Docs update for HaloAPI ${{ steps.context.outputs.tag_name }}"
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 +182 to +186

Copilot AI Apr 27, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
} finally {
Pop-Location
}
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ jobs:
build:
name: Build Module
runs-on: windows-latest
if: startsWith(github.ref, 'refs/tags/v')
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Validate tag source
if: github.event_name != 'workflow_dispatch'
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
Expand Down Expand Up @@ -84,7 +85,7 @@ jobs:
name: Publish Module
runs-on: windows-latest
needs: build
if: startsWith(github.ref, 'refs/tags/v')
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v')
environment:
name: production
url: https://www.powershellgallery.com/packages/HaloAPI
Expand Down
24 changes: 19 additions & 5 deletions .github/workflows/sync-development-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Copilot AI Apr 27, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
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
Expand Down Expand Up @@ -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

Copilot AI Apr 27, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
} finally {
Pop-Location
}
13 changes: 13 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@
],
"isBackground": false,
"problemMatcher": []
},
{
"label": "Build and Generate Documentation",
"type": "shell",
"command": "pwsh",
"args": [
"-File",
".\\DevOps\\Build\\build.ps1",
"-TaskNames",
"build,updateHelp,publishDocs"
],
"isBackground": false,
"problemMatcher": []
}
]
}