From aa3e770e4ad4a686f5915b7769e42af822a51343 Mon Sep 17 00:00:00 2001 From: Drew Hudec Date: Tue, 10 Mar 2026 22:11:43 -0400 Subject: [PATCH] feat(ENG-10254): pass author override through deploy slack action chain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When workflows are triggered via workflow_dispatch (e.g. dev→UAT promotion), github.actor becomes github-actions[bot], causing failure notifications to tag @engineers instead of the person who merged. This adds an optional author input that flows through deploy-slack-action → helper-slack-action → useConfig.ts to override the actor lookup. Co-Authored-By: Claude Opus 4.6 (1M context) --- deploy-slack-action/action.yml | 3 +++ helper-slack-action/action.yml | 2 ++ slack-javascript-action/dist/deploy/index.js | 13 +++++++++---- slack-javascript-action/src/useConfig.ts | 10 +++++++--- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/deploy-slack-action/action.yml b/deploy-slack-action/action.yml index fa8107f8..87d085cc 100644 --- a/deploy-slack-action/action.yml +++ b/deploy-slack-action/action.yml @@ -9,6 +9,8 @@ inputs: required: true mention-person: description: "User to mention in message" + author: + description: "Override the GitHub actor (for dispatched workflows)" status: description: 'Status of the deployment [start, done, request, success, cancelled, failure]' default: 'start' @@ -29,5 +31,6 @@ runs: slack-api-token: ${{ inputs.slack-api-token }} channel: ${{ inputs.channel }} mention-person: ${{ inputs.mention-person }} + author: ${{ inputs.author }} status: ${{ inputs.status }} extras: nope \ No newline at end of file diff --git a/helper-slack-action/action.yml b/helper-slack-action/action.yml index af7ff80b..64564d4f 100644 --- a/helper-slack-action/action.yml +++ b/helper-slack-action/action.yml @@ -12,6 +12,8 @@ inputs: required: true mention-person: description: "User to mention in message" + author: + description: "Override the GitHub actor (for dispatched workflows)" status: description: "Status of run [start, done, request]" default: "start" diff --git a/slack-javascript-action/dist/deploy/index.js b/slack-javascript-action/dist/deploy/index.js index 3032dad1..fcbbea60 100644 --- a/slack-javascript-action/dist/deploy/index.js +++ b/slack-javascript-action/dist/deploy/index.js @@ -579,10 +579,15 @@ const getReleaseNotes = (githubContext) => { } return "no release notes"; }; -const getAuthor = (githubContext) => githubContext.event.release && - !githubContext.event.release.author.login.includes("github-actions") - ? githubContext.event.release.author.login - : githubContext.actor; +const getAuthor = (githubContext) => { + const authorOverride = (0, core_1.getInput)("author"); + if (authorOverride) + return authorOverride; + return githubContext.event.release && + !githubContext.event.release.author.login.includes("github-actions") + ? githubContext.event.release.author.login + : githubContext.actor; +}; const getDateTime = () => { return Intl.DateTimeFormat("en", { timeZone: "America/Chicago", diff --git a/slack-javascript-action/src/useConfig.ts b/slack-javascript-action/src/useConfig.ts index 539ef9e0..dd70bec4 100644 --- a/slack-javascript-action/src/useConfig.ts +++ b/slack-javascript-action/src/useConfig.ts @@ -61,11 +61,15 @@ const getReleaseNotes = (githubContext: GithubContextType): string => { return "no release notes"; }; -const getAuthor = (githubContext: GithubContextType): string => - githubContext.event.release && - !githubContext.event.release.author.login.includes("github-actions") +const getAuthor = (githubContext: GithubContextType): string => { + const authorOverride = getInput("author"); + if (authorOverride) return authorOverride; + + return githubContext.event.release && + !githubContext.event.release.author.login.includes("github-actions") ? githubContext.event.release.author.login : githubContext.actor; +}; const getDateTime = (): string => { return Intl.DateTimeFormat("en", {