Skip to content

Commit 967ad5f

Browse files
HeyItsGilbertclaude
andcommitted
ci: run release on pushes to main via fixed publish.yaml
Rename release.yml to publish.yaml and fix it so releases run on every push to main (the previous publish.yaml startup-failed on each main push, and the tag-triggered release.yml never ran and was itself broken). The reusable PowerShellOrg/.github powershell-release.yml@main is built for this model: its check_version job compares the manifest version against PSGallery and gates both create_release and publish on (version_bumped || force), so pushing to main only publishes when the manifest version is actually new. Fixes applied to the call: - Trigger on push to main instead of tags ['v*']. - Drop the module-name input, which the reusable workflow does not declare (it derives the module name itself); passing it caused a startup failure. - Pass the secret as PS_GALLERY_KEY (the reusable's required secret name) sourced from the repo's PS_GALLERY_KEY secret. release.yml previously passed a non-existent PSGALLERY_API_KEY. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 5610581 commit 967ad5f

2 files changed

Lines changed: 18 additions & 50 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ on:
99
description: "The version to publish. Leave empty to use the version in the module manifest."
1010
required: false
1111
type: string
12-
isPrerelease:
13-
description: "Is this a prerelease version?"
12+
force:
13+
description: "If true, bypass the PSGallery version existence check. Use when re-triggering a failed publish job (pattern: force=true, create_release=false, publish=true)."
1414
required: false
1515
type: boolean
1616
default: false
@@ -19,14 +19,25 @@ on:
1919
required: false
2020
type: boolean
2121
default: false
22-
permissions:
23-
contents: write
22+
create_release:
23+
description: "If false, skip creating the GitHub release and tag."
24+
required: false
25+
type: boolean
26+
default: true
27+
publish:
28+
description: "If false, skip publishing to PowerShell Gallery."
29+
required: false
30+
type: boolean
31+
default: true
32+
2433
jobs:
2534
publish:
26-
name: Publish Module
2735
uses: PowerShellOrg/.github/.github/workflows/powershell-release.yml@main
2836
with:
2937
version: ${{ inputs.version || '' }}
30-
isPrerelease: ${{ inputs.isPrerelease || false }}
38+
force: ${{ inputs.force || false }}
3139
dry_run: ${{ inputs.dry_run || false }}
32-
secrets: inherit
40+
create_release: ${{ github.event_name != 'workflow_dispatch' || inputs.create_release }}
41+
publish: ${{ github.event_name != 'workflow_dispatch' || inputs.publish }}
42+
secrets:
43+
PS_GALLERY_KEY: ${{ secrets.PS_GALLERY_KEY }}

.github/workflows/release.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)