Skip to content

Commit 2571b36

Browse files
committed
Ignore metadata to test workflow
1 parent a495e43 commit 2571b36

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/release.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ permissions:
3535

3636
env:
3737
CODER_RELEASE: ${{ github.event.inputs.snapshot && 'false' || 'true' }}
38+
DRY_RUN: ${{ (github.event.inputs.dry_run || github.event.inputs.snapshot) && 'true' || 'false' }}
3839

3940
jobs:
4041
release:
@@ -115,6 +116,11 @@ jobs:
115116
ref=HEAD
116117
old_version="$(git describe --abbrev=0 "$ref^1")"
117118
119+
if [[ $DRY_RUN == true ]]; then
120+
# Allow dry-run of branches to pass.
121+
export CODER_IGNORE_MISSING_COMMIT_METADATA=1
122+
fi
123+
118124
# Cache commit metadata.
119125
. ./scripts/release/check_commit_metadata.sh "$old_version" "$ref"
120126

scripts/release/check_commit_metadata.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ if [[ -z $to_ref ]]; then
2626
error "No to_ref specified"
2727
fi
2828

29+
ignore_missing_metadata=${CODER_IGNORE_MISSING_COMMIT_METADATA:-0}
30+
if [[ $ignore_missing_metadata == 1 ]]; then
31+
log "WARNING: Ignoring missing commit metadata, breaking changes may be missed."
32+
fi
33+
2934
range="$from_ref..$to_ref"
3035

3136
# Check dependencies.
@@ -88,7 +93,7 @@ main() {
8893
commit_prefix=${parts[2]}
8994

9095
# Safety-check, guarantee all commits had their metadata fetched.
91-
if [[ ! -v labels[$commit_sha_long] ]]; then
96+
if [[ $ignore_missing_metadata != 1 ]] && [[ ! -v labels[$commit_sha_long] ]]; then
9297
error "Metadata missing for commit $commit_sha_short"
9398
fi
9499

0 commit comments

Comments
 (0)