diff --git a/.github/workflows/maintainer-command-reactions.yml b/.github/workflows/maintainer-command-reactions.yml index 2970777a6a5..b45224b342b 100644 --- a/.github/workflows/maintainer-command-reactions.yml +++ b/.github/workflows/maintainer-command-reactions.yml @@ -61,6 +61,10 @@ jobs: commandLine.startsWith("/autoclose ") || commandLine === "/clownfish autoclose" || commandLine.startsWith("/clownfish autoclose "); + const isClownfishCommand = + isAutocloseCommand || + commandLine === "/clownfish automerge" || + commandLine.startsWith("/clownfish automerge "); if (!issue.pull_request && !isAutocloseCommand) { core.info("Skipping non-autoclose command reaction because the comment is not on a pull request."); @@ -89,6 +93,12 @@ jobs: return; } + const tokenIsClownfishApp = "${{ steps.clownfish-token.outputs.token != '' }}" === "true"; + if (isClownfishCommand && !tokenIsClownfishApp) { + core.info("Skipping Clownfish command reaction because the Clownfish App token is unavailable."); + return; + } + async function react(content) { try { await github.rest.reactions.createForIssueComment({