Skip to content

Commit 9cbc765

Browse files
authored
fix: comprehensive workflow and build reliability fixes (#411)
Resolves CI failures and supply-chain/release issues across the three package pipelines (psdocs, psdocs-azure, vscode-extension). Build & bootstrap - Install missing InvokeBuild in build-psdocs; trust PSGallery non-interactively; add .NET 7.0 (PSDocs targets net7.0) - Cross-platform PSModulePath via [IO.Path]::PathSeparator; fix hashFiles glob pattern; expand path filter to include root build files Release workflow - Pass tag version through to Invoke-Build (was silently defaulting to 0.0.1) - Drop conflicting --generate-notes flag from gh release create - Use repo-root CHANGELOG.md for psdocs-azure VS Code extension - Migrate to ESLint 9 flat config (eslint.config.mjs); add typescript-eslint + @eslint/js; remove deprecated --ext flag and legacy .eslintrc.json - Relax presets to preserve original rule set (no behavior change vs. subtree) - Pin @types/vscode to ~1.89.0 to match engines.vscode (vsce requirement) - Fix VSCE_PAT gate to use secrets context (step env not available at if: time) - Regenerate package-lock.json Hardening & cleanup - Pin microsoft/ps-docs action to SHA (supply-chain) - Correct site_url in mkdocs.yml - Delete inert packages/psdocs/.github/workflows/build.yaml (GitHub only reads root .github/workflows/) Tests - Regenerate example template READMEs to match generator output (drop hardcoded Template-Pass badge not produced by Azure.Template.Doc.ps1) - Remove @types/glob (conflicts with glob@11's bundled types)
1 parent 09c759a commit 9cbc765

18 files changed

Lines changed: 256 additions & 514 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ jobs:
3535
BASE_SHA="${{ github.event.pull_request.base.sha }}"
3636
fi
3737
CHANGED=$(git diff --name-only "$BASE_SHA" "${{ github.sha }}" 2>/dev/null || echo "")
38-
echo "psdocs=$(echo "$CHANGED" | grep -qE '^(packages/psdocs/|build/)' && echo true || echo false)" >> $GITHUB_OUTPUT
39-
echo "psdocs-azure=$(echo "$CHANGED" | grep -qE '^(packages/psdocs-azure/|packages/psdocs/|build/)' && echo true || echo false)" >> $GITHUB_OUTPUT
40-
echo "vscode=$(echo "$CHANGED" | grep -qE '^packages/vscode-extension/' && echo true || echo false)" >> $GITHUB_OUTPUT
38+
echo "psdocs=$(echo "$CHANGED" | grep -qE '^(packages/psdocs/|build/|scripts/|build\.ps1)' && echo true || echo false)" >> $GITHUB_OUTPUT
39+
echo "psdocs-azure=$(echo "$CHANGED" | grep -qE '^(packages/psdocs-azure/|packages/psdocs/|build/|scripts/|build\.ps1)' && echo true || echo false)" >> $GITHUB_OUTPUT
40+
echo "vscode=$(echo "$CHANGED" | grep -qE '^(packages/vscode-extension/|\.github/workflows/vscode-ci\.yml)' && echo true || echo false)" >> $GITHUB_OUTPUT
4141
4242
build-psdocs:
4343
needs: changes
@@ -51,11 +51,15 @@ jobs:
5151
- name: Setup .NET
5252
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
5353
with:
54-
dotnet-version: ${{ env.DOTNET_VERSION }}
54+
dotnet-version: |
55+
7.0.x
56+
${{ env.DOTNET_VERSION }}
5557
5658
- name: Setup PowerShell
5759
shell: pwsh
5860
run: |
61+
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
62+
Install-Module -Name InvokeBuild -MinimumVersion 5.4.0 -Scope CurrentUser -Force
5963
if (Test-Path packages/psdocs/pipeline.build.ps1) {
6064
Set-Location packages/psdocs
6165
Invoke-Build Build -File ./pipeline.build.ps1
@@ -72,7 +76,7 @@ jobs:
7276
}
7377
7478
- name: Upload PSDocs Module
75-
if: success() && hashFiles('packages/psdocs/out/modules/PSDocs/') != ''
79+
if: success() && hashFiles('packages/psdocs/out/modules/PSDocs/**') != ''
7680
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
7781
with:
7882
name: psdocs-module

.github/workflows/docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
3333
3434
- name: Generate docs
35-
uses: microsoft/ps-docs@main
35+
uses: microsoft/ps-docs@333fc57dfef2479e0c6457600bb4c7a1316783ba # main
3636
with:
3737
modules: PSDocs,PSDocs.Azure
3838
inputPath: packages/psdocs-azure/templates

.github/workflows/release-psdocs-azure.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
shell: pwsh
4040
working-directory: packages/psdocs-azure
4141
run: |
42-
Invoke-Build Build -File ./pipeline.build.ps1
42+
Invoke-Build Build -File ./pipeline.build.ps1 -Build '${{ steps.version.outputs.version }}'
4343
4444
- name: Publish to PSGallery
4545
shell: pwsh
@@ -54,5 +54,4 @@ jobs:
5454
run: |
5555
gh release create "${{ github.ref_name }}" \
5656
--title "PSDocs.Azure v${{ steps.version.outputs.version }}" \
57-
--notes-file packages/psdocs-azure/CHANGELOG.md \
58-
--generate-notes
57+
--notes-file CHANGELOG.md

.github/workflows/release-psdocs.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
shell: pwsh
4040
working-directory: packages/psdocs
4141
run: |
42-
Invoke-Build Build -File ./pipeline.build.ps1
42+
Invoke-Build Build -File ./pipeline.build.ps1 -Build '${{ steps.version.outputs.version }}'
4343
4444
- name: Publish to PSGallery
4545
shell: pwsh
@@ -54,5 +54,4 @@ jobs:
5454
run: |
5555
gh release create "${{ github.ref_name }}" \
5656
--title "PSDocs v${{ steps.version.outputs.version }}" \
57-
--notes-file packages/psdocs/CHANGELOG.md \
58-
--generate-notes
57+
--notes-file packages/psdocs/CHANGELOG.md

.github/workflows/release-vscode.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,4 @@ jobs:
7878
gh release create "${{ github.ref_name }}" \
7979
--title "VS Code Extension v${{ steps.version.outputs.version }}" \
8080
--notes-file packages/vscode-extension/CHANGELOG.md \
81-
--generate-notes \
8281
"${{ steps.vsix.outputs.path }}"

.github/workflows/vscode-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ jobs:
161161
echo "Found VSIX: $VSIX_FILE"
162162
163163
- name: Publish to VS Marketplace (Pre-release)
164-
if: env.VSCE_PAT != ''
164+
if: ${{ secrets.VSCE_PAT != '' }}
165165
working-directory: packages/vscode-extension/out/package
166166
env:
167167
VSCE_PAT: ${{ secrets.VSCE_PAT }}

build/common.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function Get-LocalPSDocsModule {
7777

7878
if (Test-Path $localModule) {
7979
Write-Host "Using local PSDocs module from: $localModule"
80-
$env:PSModulePath = "$localModule;$env:PSModulePath"
80+
$env:PSModulePath = "$localModule$([IO.Path]::PathSeparator)$env:PSModulePath"
8181
return $true
8282
}
8383

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
site_name: PSDocs for Azure
2-
site_url: https://github.com/Azure/PSDocs.Azure
2+
site_url: https://azure.github.io/PSDocs.Azure/
33
site_description: Generate documentation from Azure infrastructure as code (IaC) artifacts.
44
site_author: Microsoft
55

packages/psdocs-azure/examples/bicep/storage/v1/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
Create or update a Storage Account.
44

5-
![Template checks](https://img.shields.io/badge/Template-Pass-green?style=flat-square)
6-
75
This template deploys a Storage Account including blob containers and files shares. Encryption in transit it enabled using a minimum of TLS 1.2.
86

97
## Parameters

packages/psdocs-azure/templates/acr/v1/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Container Registry
22

3-
![Template checks](https://img.shields.io/badge/Template-Pass-green?style=flat-square)
4-
53
Create or update a Container Registry.
64

75
## Parameters

0 commit comments

Comments
 (0)