Skip to content

Commit 3a9fc91

Browse files
committed
Refactor out a function to tell whether a package is both MSYS/MINGW or not
This function will be used to determine whether a release note is added without _both_ the MSYS and MINGW packages having been deployed. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 449eca7 commit 3a9fc91

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

GitForWindowsHelper/component-updates.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ const isMSYSPackage = package_name => {
4242
&& !package_name.startsWith('mingw-w64-')
4343
}
4444

45+
const packageNeedsBothMSYSAndMINGW = package_name => {
46+
return ['openssl', 'curl', 'gnutls', 'pcre2'].includes(package_name)
47+
}
48+
4549
const needsSeparateARM64Build = package_name => {
4650
if (package_name === 'git-extra') return true
4751
return package_name.startsWith('mingw-w64-') && ![
@@ -108,5 +112,6 @@ module.exports = {
108112
guessReleaseNotes,
109113
prettyPackageName,
110114
isMSYSPackage,
115+
packageNeedsBothMSYSAndMINGW,
111116
needsSeparateARM64Build
112117
}

GitForWindowsHelper/slash-commands.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module.exports = async (context, req) => {
5454

5555
await checkPermissions()
5656

57-
const { guessComponentUpdateDetails } = require('./component-updates')
57+
const { guessComponentUpdateDetails, packageNeedsBothMSYSAndMINGW } = require('./component-updates')
5858
const { package_name, version } = guessComponentUpdateDetails(req.body.issue.title, req.body.issue.body)
5959

6060
await thumbsUp()
@@ -96,7 +96,7 @@ module.exports = async (context, req) => {
9696
);
9797
({ html_url: commentURL, id: commentId } = await appendToIssueComment(context, await getToken(), owner, repo, commentId, `The${packageType ? ` ${packageType}` : ''} workflow run [was started](${answer.html_url})`))
9898
}
99-
if (!['openssl', 'curl', 'gnutls', 'pcre2'].includes(package_name)) {
99+
if (!packageNeedsBothMSYSAndMINGW(package_name)) {
100100
await openPR(package_name)
101101
} else {
102102
await openPR(package_name, 'MSYS')

0 commit comments

Comments
 (0)