Skip to content

Commit a0e2193

Browse files
author
Ralph Küpper
committed
fix(release): avoid changelog preflight pipefail
1 parent db821b5 commit a0e2193

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

.github/workflows/release-packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ jobs:
136136
echo "::error::tag $TAG already exists — the version in Cargo.toml was already released. Land a version bump or use existing_tag to re-publish."
137137
exit 1
138138
fi
139-
if ! find changelog.d -maxdepth 1 -type f -name '[0-9]*.md' | grep -q .; then
139+
if [ -z "$(find changelog.d -maxdepth 1 -type f -name '[0-9]*.md' -print -quit)" ]; then
140140
echo "::error::no fragments in changelog.d/ — the release notes are cut from them; nothing to release."
141141
exit 1
142142
fi

scripts/publish/publish.test.mts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,8 @@ test('pipeline.mts: OIDC publication and release receipt are pinned to one commi
367367
assert.match(workflow, /\[ "\$REF_NAME" = "main" \]/)
368368
assert.match(workflow, /"\$REF" != refs\/heads\/\*/)
369369
assert.match(workflow, /\[ "\$CANDIDATE_SHA" != "\$SHA" \]/)
370+
assert.match(workflow, /find changelog\.d[^\n]+-print -quit/)
371+
assert.doesNotMatch(workflow, /find changelog\.d[^\n]+\|\s*grep -q/)
370372
assert.match(workflow, /needs: \[preflight, build, build-cross, npm-publish\]/)
371373
assert.match(workflow, /needs\.npm-publish\.result == 'success'/)
372374
})

0 commit comments

Comments
 (0)