Skip to content

Commit fdd10cc

Browse files
ANcpLuaclaude
andcommitted
fix: deploy step now diffs against previous tag when HEAD is tagged
When the version tag sits on HEAD, `git diff $tag HEAD` is always empty, so the publish step was permanently skipped. Now detects tagged HEAD and diffs against the tag before it instead. Also adds workflow_dispatch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8b7f3be commit fdd10cc

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
branches:
55
- "main"
66
pull_request:
7+
workflow_dispatch:
78

89
concurrency:
910
group: ci-${{ github.ref }}
@@ -134,7 +135,16 @@ jobs:
134135
- name: Must Publish Packages
135136
id: has_changes
136137
run: |
137-
$PreviousTag = git describe --tags --abbrev=0 2>$null
138+
# When HEAD is tagged (release commit), diff against the PREVIOUS tag
139+
# to detect changes. Without this, git diff $tag HEAD is always empty.
140+
$ExactTag = git describe --tags --exact-match HEAD 2>$null
141+
if ($ExactTag) {
142+
Write-Host "HEAD is tagged: $ExactTag — finding previous tag"
143+
$PreviousTag = git describe --tags --abbrev=0 "$ExactTag~1" 2>$null
144+
} else {
145+
$PreviousTag = git describe --tags --abbrev=0 2>$null
146+
}
147+
138148
if ($PreviousTag) {
139149
Write-Host "Previous tag: $PreviousTag"
140150
$Changes = git diff --name-only $PreviousTag HEAD -- '*.nuspec' 'src/**/*'

0 commit comments

Comments
 (0)