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