@@ -26,6 +26,11 @@ if [[ -z $to_ref ]]; then
26
26
error " No to_ref specified"
27
27
fi
28
28
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
+
29
34
range=" $from_ref ..$to_ref "
30
35
31
36
# Check dependencies.
@@ -91,9 +96,11 @@ main() {
91
96
commit_sha_long=${parts[1]}
92
97
commit_prefix=${parts[2]}
93
98
94
- # Safety-check, guarantee all commits had their metadata fetched.
95
- if [[ ! -v labels[$commit_sha_long ] ]]; then
96
- error " Metadata missing for commit $commit_sha_short "
99
+ if [[ $ignore_missing_metadata != 1 ]]; then
100
+ # Safety-check, guarantee all commits had their metadata fetched.
101
+ if [[ ! -v labels[$commit_sha_long ] ]]; then
102
+ error " Metadata missing for commit $commit_sha_short "
103
+ fi
97
104
fi
98
105
99
106
# Store the commit title for later use.
@@ -103,11 +110,11 @@ main() {
103
110
104
111
# First, check the title for breaking changes. This avoids doing a
105
112
# GH API request if there's a match.
106
- if [[ $commit_prefix =~ $breaking_title ]] || [[ ${labels[$commit_sha_long]} = * " label:$breaking_label " * ]]; then
113
+ if [[ $commit_prefix =~ $breaking_title ]] || [[ ${labels[$commit_sha_long]:- } = * " label:$breaking_label " * ]]; then
107
114
COMMIT_METADATA_CATEGORY[$commit_sha_short ]=$breaking_category
108
115
COMMIT_METADATA_BREAKING=1
109
116
continue
110
- elif [[ ${labels[$commit_sha_long]} = * " label:$security_label " * ]]; then
117
+ elif [[ ${labels[$commit_sha_long]:- } = * " label:$security_label " * ]]; then
111
118
COMMIT_METADATA_CATEGORY[$commit_sha_short ]=$security_label
112
119
continue
113
120
fi
0 commit comments