Skip to content

ci: delegate to PowerShellOrg reusable workflows#184

Open
HeyItsGilbert wants to merge 1 commit into
mainfrom
ci/use-powershellorg-reusable-workflows
Open

ci: delegate to PowerShellOrg reusable workflows#184
HeyItsGilbert wants to merge 1 commit into
mainfrom
ci/use-powershellorg-reusable-workflows

Conversation

@HeyItsGilbert
Copy link
Copy Markdown
Member

@HeyItsGilbert HeyItsGilbert commented May 26, 2026

Summary

  • CI.yml simplified to a single uses: call to PowerShellOrg/.github/.github/workflows/powershell-ci.yml@main — covers PS 5.1 and 7.x on Windows/Linux/macOS, installs deps, and runs Init/Test/Analyze via Invoke-psake
  • publish.yml added — triggers on v* tag push, delegates to powershell-release.yml@main (Init → Test → Analyze → Build → Publish → GitHub Release); requires PSGALLERY_API_KEY secret set in repo settings
  • psakeFile.ps1 — added Analyze task (runs Invoke-ScriptAnalyzer on staged output, fails on Error severity); wired $PSBPreference.Publish.ApiKey from $env:PSGALLERY_API_KEY

Test plan

  • CI run on this PR validates Init/Test/Analyze pass across all matrix legs
  • Confirm PSGALLERY_API_KEY secret is set in repo settings before tagging a release
  • Dry-run publish by triggering publish.yml via workflow_dispatch on a pre-release branch

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings May 26, 2026 04:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the repository’s GitHub Actions configuration to PowerShellOrg reusable workflows and aligns the repo’s psake tasks with what those workflows expect (including a dedicated Analyze task and publish API key wiring).

Changes:

  • Replace the existing multi-job CI workflow with a single call to PowerShellOrg/.github’s powershell-ci.yml.
  • Add a tag-triggered (and manually triggerable) publish workflow delegating to powershell-release.yml.
  • Add a new Analyze psake task that runs PSScriptAnalyzer on the staged module output; wire publish API key from PSGALLERY_API_KEY.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
psakeFile.ps1 Adds Analyze task and maps $env:PSGALLERY_API_KEY into PowerShellBuild publish preferences.
.github/workflows/ci.yml Simplifies CI to a single reusable workflow invocation.
.github/workflows/publish.yml Adds release workflow that delegates publishing/release steps to a reusable workflow.
Comments suppressed due to low confidence (1)

.github/workflows/ci.yml:25

  • This change removes the in-repo step that published JUnit test results as PR check runs (previously via publish-unit-test-result-action). If that reporting is still desired, ensure powershell-ci.yml provides equivalent test result publishing, or add it back in this workflow.
jobs:
  ci:
    uses: PowerShellOrg/.github/.github/workflows/powershell-ci.yml@main
    permissions:
      contents: read


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread psakeFile.ps1
$PSBPreference.Test.ExcludeTagFilter = @('WindowsOnly')
}

$PSBPreference.Publish.ApiKey = $env:PSGALLERY_API_KEY
Comment thread psakeFile.ps1 Outdated
$results = Invoke-ScriptAnalyzer -Path $PSBPreference.Build.ModuleOutDir -Recurse -Severity Error
if ($results) {
$results | Format-Table -AutoSize
throw "PSScriptAnalyzer found $($results.Count) error(s)."
Comment thread .github/workflows/ci.yml Outdated
Comment on lines 21 to 24
ci:
uses: PowerShellOrg/.github/.github/workflows/powershell-ci.yml@main
permissions:
contents: read
Comment thread .github/workflows/publish.yml Outdated
Comment on lines +9 to +16
release:
uses: PowerShellOrg/.github/.github/workflows/powershell-release.yml@main
with:
module-name: PSDepend
secrets:
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
permissions:
contents: write
- CI.yml now calls powershell-ci.yml@main (PS 5.1 + 7.x, all platforms,
  installs deps and runs Init/Test/Analyze directly via Invoke-psake)
- publish.yml added: triggers on v* tags, calls powershell-release.yml@main
  (Init → Test → Analyze → Build → Publish → GitHub Release)
- psakeFile.ps1: add Analyze task (required by both reusable workflows)
  and wire $PSBPreference.Publish.ApiKey from $env:PSGALLERY_API_KEY

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@HeyItsGilbert HeyItsGilbert force-pushed the ci/use-powershellorg-reusable-workflows branch from 2c1a6d4 to 52cd558 Compare May 26, 2026 04:47
Comment thread psakeFile.ps1
Task InstallLocal -Depends StageFiles {
$label = if ($PreReleaseLabel) { $PreReleaseLabel } else { "pre-$(git rev-parse --short HEAD)" }
$label = if ($PreReleaseLabel) {
$PreReleaseLabel
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[PSScriptAnalyzer] reported by reviewdog 🐶

Suggested change
$PreReleaseLabel
$PreReleaseLabel

Comment thread psakeFile.ps1
$label = if ($PreReleaseLabel) {
$PreReleaseLabel
} else {
"pre-$(git rev-parse --short HEAD)"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[PSScriptAnalyzer] reported by reviewdog 🐶

Suggested change
"pre-$(git rev-parse --short HEAD)"
"pre-$(git rev-parse --short HEAD)"

@HeyItsGilbert HeyItsGilbert linked an issue May 26, 2026 that may be closed by this pull request
@github-actions
Copy link
Copy Markdown

Test Results

    3 files   -   1     60 suites   - 20   1m 57s ⏱️ -24s
  940 tests  - 411    888 ✅  - 359  52 💤  - 52  0 ❌ ±0 
1 257 runs   - 419  1 197 ✅  - 359  60 💤  - 60  0 ❌ ±0 

Results for commit 52cd558. ± Comparison against base commit 61060f3.

This pull request removes 411 tests.
/home/runner/work/PSDepend/PSDepend/Tests/Chocolatey.Type.Tests.ps1 ‑ Chocolatey script.Defaults Source to https://chocolatey.org/api/v2/ when not supplied
/home/runner/work/PSDepend/PSDepend/Tests/Chocolatey.Type.Tests.ps1 ‑ Chocolatey script.Forwards Credential to choco as --username / --password args
/home/runner/work/PSDepend/PSDepend/Tests/Chocolatey.Type.Tests.ps1 ‑ Chocolatey script.Invokes choco upgrade with -Force when -Force switch is set
/home/runner/work/PSDepend/PSDepend/Tests/Chocolatey.Type.Tests.ps1 ‑ Chocolatey script.Passes --yes to choco upgrade to suppress interactive prompts
/home/runner/work/PSDepend/PSDepend/Tests/Command.Type.Tests.ps1 ‑ Command script.Executes the Source string as PowerShell in the current session
/home/runner/work/PSDepend/PSDepend/Tests/Command.Type.Tests.ps1 ‑ Command script.Iterates multiple Source entries
/home/runner/work/PSDepend/PSDepend/Tests/Command.Type.Tests.ps1 ‑ Command script.Throws a terminating error when -FailOnError is specified
/home/runner/work/PSDepend/PSDepend/Tests/Command.Type.Tests.ps1 ‑ Command script.Writes a non-terminating error and continues by default when the Source errors
/home/runner/work/PSDepend/PSDepend/Tests/DotnetSdk.Type.Tests.ps1 ‑ DotnetSdk script.Calls Install-Dotnet when Test-Dotnet reports SDK is missing
/home/runner/work/PSDepend/PSDepend/Tests/DotnetSdk.Type.Tests.ps1 ‑ DotnetSdk script.PSDependAction Test delegates to Test-Dotnet
…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add GitHub Actions Publish workflow (PSGallery release)

2 participants