diff --git a/build/command/index.js b/build/command/index.js index 68307fb59..9799c1eb2 100644 --- a/build/command/index.js +++ b/build/command/index.js @@ -38583,6 +38583,7 @@ function commandInput() { return { reaction: '+1', githubToken: (0, core_1.getInput)('github-token'), + commandOverride: (0, core_1.getInput)('command-override'), }; } exports.commandInput = commandInput; @@ -38592,7 +38593,12 @@ async function commandAction(input = commandInput()) { if (!comment) { return; } - const command = (0, expo_1.parseCommand)(comment); + let commandSource = comment; + if (input.commandOverride) { + (0, core_1.info)(`Overriding command with: ${input.commandOverride}`); + commandSource = input.commandOverride; + } + const command = (0, expo_1.parseCommand)(commandSource); if (!command) { (0, core_1.info)("Comment didn't contain a valid expo/eas command"); return; diff --git a/bun.lockb b/bun.lockb index 71221f0ce..7ba74eded 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/command/action.yml b/command/action.yml index 512c42423..a38ee4247 100644 --- a/command/action.yml +++ b/command/action.yml @@ -13,3 +13,6 @@ inputs: description: GitHub access token to comment on PRs required: false default: ${{ github.token }} + command-override: + description: Command to run (if not provided, taken from comment) + required: false diff --git a/src/actions/command.ts b/src/actions/command.ts index f30b9c9cf..dfcfc6790 100644 --- a/src/actions/command.ts +++ b/src/actions/command.ts @@ -20,6 +20,7 @@ export function commandInput() { return { reaction: '+1' as Reaction['content'], githubToken: getInput('github-token'), + commandOverride: getInput('command-override'), }; } @@ -31,7 +32,13 @@ export async function commandAction(input = commandInput()) { return; } - const command = parseCommand(comment); + let commandSource = comment; + if (input.commandOverride) { + info(`Overriding command with: ${input.commandOverride}`); + commandSource = input.commandOverride; + } + + const command = parseCommand(commandSource); if (!command) { info("Comment didn't contain a valid expo/eas command"); return;