Skip to content

Commit 1cf6d04

Browse files
committed
/deploy: optionally accept a package name as argument
Sometimes the name of the package cannot be determined from the Pull Request, or we need to deploy a dependent package in addition to the one that is changed in that Pull Request. In either case it is necessary to specify explictly which package to deploy. Let's support `/deploy <package-name>` for these instances. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 53370e8 commit 1cf6d04

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

GitForWindowsHelper/slash-commands.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ module.exports = async (context, req) => {
103103
return `I edited the comment: ${commentURL}`
104104
}
105105

106-
if (command == '/deploy') {
106+
const deployArg = command.startsWith('/deploy ') ? command.substring(8).trim() : undefined
107+
if (deployArg || command === '/deploy') {
107108
if (owner !== 'git-for-windows'
108109
|| !req.body.issue.pull_request
109110
|| !['build-extra', 'MINGW-packages', 'MSYS2-packages'].includes(repo)) {
@@ -113,7 +114,7 @@ module.exports = async (context, req) => {
113114
await checkPermissions()
114115

115116
const { guessComponentUpdateDetails, isMSYSPackage } = require('./component-updates')
116-
const { package_name } = guessComponentUpdateDetails(req.body.issue.title, req.body.issue.body)
117+
const { package_name } = deployArg || guessComponentUpdateDetails(req.body.issue.title, req.body.issue.body)
117118

118119
// The commit hash of the tip commit is sadly not part of the
119120
// "comment.created" webhook's payload. Therefore, we have to get it

0 commit comments

Comments
 (0)