From 978f2681593ffc0ee3b393b7490509de06a60465 Mon Sep 17 00:00:00 2001 From: Jeff Brown Tech Date: Sun, 22 Mar 2026 10:18:04 -0700 Subject: [PATCH 1/4] Move help file generation to pr --- .github/workflows/pull_request_create.yml | 17 ++++++++++------- .github/workflows/pull_request_merge.yml | 19 ------------------- 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/.github/workflows/pull_request_create.yml b/.github/workflows/pull_request_create.yml index daf9cad..84858c7 100644 --- a/.github/workflows/pull_request_create.yml +++ b/.github/workflows/pull_request_create.yml @@ -60,15 +60,18 @@ jobs: Write-Output "✓ All $($exportedFunctions.Count) exported functions have corresponding markdown files" - - name: Test XML Help Generation + - name: Generate XML Help + shell: pwsh + run: New-ExternalHelp -Path ".\docs" -OutputPath "." -Force + + - name: Commit and Push Help Updates shell: pwsh run: | - New-ExternalHelp -Path ".\docs" -OutputPath ".\test-help" -Force - if (-not (Test-Path ".\test-help\PowerAzPlus-help.xml")) { - Write-Error "Failed to generate help XML" - exit 1 - } - Write-Output "Help XML generated successfully" + git config user.email "github-actions@github.com" + git config user.name "GitHub Actions" + git add PowerAzPlus-help.xml + git commit -m "chore: update help documentation" || echo "No changes to help file" + git push - name: Test publish to PowerShell Gallery shell: pwsh diff --git a/.github/workflows/pull_request_merge.yml b/.github/workflows/pull_request_merge.yml index 3240fdf..e39b16c 100644 --- a/.github/workflows/pull_request_merge.yml +++ b/.github/workflows/pull_request_merge.yml @@ -13,25 +13,6 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Install PlatyPS - shell: pwsh - run: Install-Module -Name PlatyPS -Force -Scope CurrentUser - - - name: Generate XML Help - shell: pwsh - run: New-ExternalHelp -Path ".\docs" -OutputPath "." -Force - - - name: Commit and Push Help Updates - shell: pwsh - run: | - git config user.email "github-actions@github.com" - git config user.name "GitHub Actions" - git add PowerAzPlus-help.xml - git commit -m "chore: update help documentation" || echo "No changes to help file" - git push - name: Publish module to PowerShell Gallery shell: pwsh From 5ee6663381038a2ca1bd55d8d0ee976f4dba77c5 Mon Sep 17 00:00:00 2001 From: Jeff Brown Tech Date: Sun, 22 Mar 2026 10:21:09 -0700 Subject: [PATCH 2/4] Update help documentation commit command and push behavior --- .github/workflows/pull_request_create.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull_request_create.yml b/.github/workflows/pull_request_create.yml index 84858c7..8360d51 100644 --- a/.github/workflows/pull_request_create.yml +++ b/.github/workflows/pull_request_create.yml @@ -70,8 +70,9 @@ jobs: git config user.email "github-actions@github.com" git config user.name "GitHub Actions" git add PowerAzPlus-help.xml - git commit -m "chore: update help documentation" || echo "No changes to help file" - git push + git commit -m "update help documentation" || echo "No changes to help file" + git push origin HEAD:${{ github.head_ref }} + continue-on-error: true - name: Test publish to PowerShell Gallery shell: pwsh From e7761111021c226c3b8e0129d1af794e78252e87 Mon Sep 17 00:00:00 2001 From: Jeff Brown Tech Date: Sun, 22 Mar 2026 10:26:27 -0700 Subject: [PATCH 3/4] Refactor workflow job name and add permissions for pull requests --- .github/workflows/pull_request_create.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull_request_create.yml b/.github/workflows/pull_request_create.yml index 8360d51..9941531 100644 --- a/.github/workflows/pull_request_create.yml +++ b/.github/workflows/pull_request_create.yml @@ -7,8 +7,11 @@ on: - synchronize jobs: - test: + test-module: runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write steps: - name: Checkout repository From 28c2dd5a49a88f65b3049d0deb477826f33ccf0d Mon Sep 17 00:00:00 2001 From: Jeff Brown Tech Date: Sun, 22 Mar 2026 10:32:34 -0700 Subject: [PATCH 4/4] Improve help documentation update process in workflow --- .github/workflows/pull_request_create.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull_request_create.yml b/.github/workflows/pull_request_create.yml index 9941531..988fc94 100644 --- a/.github/workflows/pull_request_create.yml +++ b/.github/workflows/pull_request_create.yml @@ -72,9 +72,15 @@ jobs: run: | git config user.email "github-actions@github.com" git config user.name "GitHub Actions" + git fetch origin ${{ github.head_ref }} + git checkout ${{ github.head_ref }} git add PowerAzPlus-help.xml - git commit -m "update help documentation" || echo "No changes to help file" - git push origin HEAD:${{ github.head_ref }} + if (!(git diff --cached --quiet)) { + git commit -m "update help documentation" + git push origin ${{ github.head_ref }} + } else { + Write-Host "No changes to help file" + } continue-on-error: true - name: Test publish to PowerShell Gallery