Skip to content

Commit b0294ff

Browse files
committed
fix dry-run release
1 parent e17fa0f commit b0294ff

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

scripts/release/publish.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,16 @@ if [[ "$stable" == 1 ]]; then
180180
fi
181181

182182
target_commitish=main # This is the default.
183-
release_branch_refname=$(git branch --remotes --contains "${new_tag}" --format '%(refname)' '*/release/*')
184-
if [[ -n "${release_branch_refname}" ]]; then
185-
# refs/remotes/origin/release/2.9 -> release/2.9
186-
target_commitish="release/${release_branch_refname#*release/}"
183+
# Skip during dry-runs
184+
if [[ "$dry_run" == 0 ]]; then
185+
release_branch_refname=$(git branch --remotes --contains "${new_tag}" --format '%(refname)' '*/release/*')
186+
if [[ -n "${release_branch_refname}" ]]; then
187+
# refs/remotes/origin/release/2.9 -> release/2.9
188+
target_commitish="release/${release_branch_refname#*release/}"
189+
fi
187190
fi
188191

192+
189193
# We pipe `true` into `gh` so that it never tries to be interactive.
190194
true |
191195
maybedryrun "$dry_run" gh release create \

0 commit comments

Comments
 (0)