Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions deploy-slack-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
2 changes: 2 additions & 0 deletions helper-slack-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 9 additions & 4 deletions slack-javascript-action/dist/deploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 7 additions & 3 deletions slack-javascript-action/src/useConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down
Loading