···77label_feature=feature
88label_ui=forgejo/ui
99label_breaking=breaking
1010+label_security=security
1011label_localization=forgejo/i18n
11121213payload=$(mktemp)
···1718 set -ex
1819 PS4='${BASH_SOURCE[0]}:$LINENO: ${FUNCNAME[0]}: '
19202121+ test_payload_labels $label_worth $label_breaking $label_security $label_bug
2222+ test "$(categorize)" = 'AA Breaking security bug fixes'
2323+2424+ test_payload_labels $label_worth $label_security $label_bug
2525+ test "$(categorize)" = 'AB Security bug fixes'
2626+2727+ test_payload_labels $label_worth $label_breaking $label_security $label_feature
2828+ test "$(categorize)" = 'AC Breaking security features'
2929+3030+ test_payload_labels $label_worth $label_security $label_feature
3131+ test "$(categorize)" = 'AD Security features'
3232+3333+ test_payload_labels $label_worth $label_security
3434+ test "$(categorize)" = 'ZA Security changes without a feature or bug label'
3535+2036 test_payload_labels $label_worth $label_breaking $label_feature
2121- test "$(categorize)" = 'AA Breaking features'
3737+ test "$(categorize)" = 'BA Breaking features'
22382339 test_payload_labels $label_worth $label_breaking $label_bug
2424- test "$(categorize)" = 'AB Breaking bug fixes'
4040+ test "$(categorize)" = 'BB Breaking bug fixes'
25412642 test_payload_labels $label_worth $label_breaking
2727- test "$(categorize)" = 'ZC Breaking changes without a feature or bug label'
4343+ test "$(categorize)" = 'ZB Breaking changes without a feature or bug label'
28442945 test_payload_labels $label_worth $label_ui $label_feature
3030- test "$(categorize)" = 'BA User Interface features'
4646+ test "$(categorize)" = 'CA User Interface features'
31473248 test_payload_labels $label_worth $label_ui $label_bug
3333- test "$(categorize)" = 'BB User Interface bug fixes'
4949+ test "$(categorize)" = 'CB User Interface bug fixes'
34503551 test_payload_labels $label_worth $label_ui
3636- test "$(categorize)" = 'ZD User Interface changes without a feature or bug label'
5252+ test "$(categorize)" = 'ZC User Interface changes without a feature or bug label'
5353+5454+ test_payload_labels $label_worth $label_localization
5555+ test "$(categorize)" = 'DA Localization'
37563857 test_payload_labels $label_worth $label_feature
3939- test "$(categorize)" = 'CA Features'
5858+ test "$(categorize)" = 'EA Features'
40594160 test_payload_labels $label_worth $label_bug
4242- test "$(categorize)" = 'CB Bug fixes'
4343-4444- test_payload_labels $label_worth $label_localization
4545- test "$(categorize)" = 'DA Localization'
6161+ test "$(categorize)" = 'EB Bug fixes'
46624763 test_payload_labels $label_worth
4864 test "$(categorize)" = 'ZE Other changes without a feature or bug label'
···5066 test_payload_labels
5167 test "$(categorize)" = 'ZF Included for completeness but not worth a release note'
52686969+ test_payload_draft "fix(security)!: breaking security bug fix"
7070+ test "$(categorize)" = 'AA Breaking security bug fixes'
7171+7272+ test_payload_draft "fix(security): security bug fix"
7373+ test "$(categorize)" = 'AB Security bug fixes'
7474+5375 test_payload_draft "feat!: breaking feature"
5454- test "$(categorize)" = 'AA Breaking features'
7676+ test "$(categorize)" = 'BA Breaking features'
55775678 test_payload_draft "fix!: breaking bug fix"
5757- test "$(categorize)" = 'AB Breaking bug fixes'
7979+ test "$(categorize)" = 'BB Breaking bug fixes'
58805981 test_payload_draft "feat: feature"
6060- test "$(categorize)" = 'CA Features'
8282+ test "$(categorize)" = 'EA Features'
61836284 test_payload_draft "fix: bug fix"
6363- test "$(categorize)" = 'CB Bug fixes'
8585+ test "$(categorize)" = 'EB Bug fixes'
64866587 test_payload_draft "something with no prefix"
6688 test "$(categorize)" = 'ZE Other changes without a feature or bug label'
···109131 is_feature=false
110132 is_localization=false
111133 is_breaking=false
134134+ is_security=false
112135113136 #
114137 # first try to figure out the category from the labels
···126149 esac
127150128151 case "$labels" in
152152+ *$label_security*)
153153+ is_security=true
154154+ ;;
155155+ esac
156156+157157+ case "$labels" in
129158 *$label_breaking*)
130159 is_breaking=true
131160 ;;
···143172 if ! $is_bug && ! $is_feature; then
144173 draft="$(jq --raw-output .Draft <$payload)"
145174 case "$draft" in
175175+ fix\(security\)!:*)
176176+ is_bug=true
177177+ is_breaking=true
178178+ is_security=true
179179+ ;;
180180+ fix\(security\):*)
181181+ is_bug=true
182182+ is_security=true
183183+ ;;
146184 fix!:*)
147185 is_bug=true
148186 is_breaking=true
···171209 fi
172210 fi
173211174174- if $is_breaking; then
212212+ if $is_security; then
213213+ if $is_bug; then
214214+ if $is_breaking; then
215215+ echo -n AA Breaking security bug fixes
216216+ else
217217+ echo -n AB Security bug fixes
218218+ fi
219219+ elif $is_feature; then
220220+ if $is_breaking; then
221221+ echo -n AC Breaking security features
222222+ else
223223+ echo -n AD Security features
224224+ fi
225225+ else
226226+ echo -n ZA Security changes without a feature or bug label
227227+ fi
228228+ elif $is_breaking; then
175229 if $is_feature; then
176176- echo -n AA Breaking features
230230+ echo -n BA Breaking features
177231 elif $is_bug; then
178178- echo -n AB Breaking bug fixes
232232+ echo -n BB Breaking bug fixes
179233 else
180180- echo -n ZC Breaking changes without a feature or bug label
234234+ echo -n ZB Breaking changes without a feature or bug label
181235 fi
182236 elif $is_ui; then
183237 if $is_feature; then
184184- echo -n BA User Interface features
238238+ echo -n CA User Interface features
185239 elif $is_bug; then
186186- echo -n BB User Interface bug fixes
240240+ echo -n CB User Interface bug fixes
187241 else
188188- echo -n ZD User Interface changes without a feature or bug label
242242+ echo -n ZC User Interface changes without a feature or bug label
189243 fi
190244 elif $is_localization; then
191245 echo -n DA Localization
192246 else
193247 if $is_feature; then
194194- echo -n CA Features
248248+ echo -n EA Features
195249 elif $is_bug; then
196196- echo -n CB Bug fixes
250250+ echo -n EB Bug fixes
197251 else
198252 echo -n ZE Other changes without a feature or bug label
199253 fi