Skip to content

Commit 8b0f2ea

Browse files
committed
fix: convert input type to boolean
1 parent eae3f10 commit 8b0f2ea

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

dist/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12926,12 +12926,13 @@ function main() {
1292612926
const slack_name = core.getInput('name');
1292712927
const slack_icon = core.getInput('icon_url');
1292812928
const slack_emoji = core.getInput('icon_emoji'); // https://www.webfx.com/tools/emoji-cheat-sheet/
12929+
const from_workflow_run = core.getInput('workflow_run') === 'true';
1292912930
// Force as secret, forces *** when trying to print or log values
1293012931
core.setSecret(github_token);
1293112932
core.setSecret(webhook_url);
1293212933
// Auth github with octokit module
1293312934
const octokit = github_1.getOctokit(github_token);
12934-
const run_id = core.getInput('workflow_run')
12935+
const run_id = from_workflow_run
1293512936
? Number(github_1.context.payload.workflow_run.id)
1293612937
: Number(github_1.context.runId);
1293712938
// Fetch workflow run data
@@ -13006,10 +13007,10 @@ function main() {
1300613007
const repo_url = `<${workflow_run.repository.html_url}|*${workflow_run.repository.full_name}*>`;
1300713008
const branch_url = `<${workflow_run.repository.html_url}/tree/${workflow_run.head_branch}|*${workflow_run.head_branch}*>`;
1300813009
const workflow_run_url = `<${workflow_run.html_url}|#${workflow_run.run_number}>`;
13009-
const event_name = core.getInput('workflow_run')
13010+
const event_name = from_workflow_run
1301013011
? github_1.context.payload.workflow_run.event
1301113012
: github_1.context.eventName;
13012-
const workflow_name = core.getInput('workflow_run')
13013+
const workflow_name = from_workflow_run
1301313014
? github_1.context.payload.workflow_run.name
1301413015
: github_1.context.workflow;
1301513016
// Example: Success: AnthonyKinson's `push` on `master` for pull_request

src/main.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,13 @@ async function main(): Promise<void> {
6565
const slack_name = core.getInput('name')
6666
const slack_icon = core.getInput('icon_url')
6767
const slack_emoji = core.getInput('icon_emoji') // https://www.webfx.com/tools/emoji-cheat-sheet/
68+
const from_workflow_run = core.getInput('workflow_run') === 'true'
6869
// Force as secret, forces *** when trying to print or log values
6970
core.setSecret(github_token)
7071
core.setSecret(webhook_url)
7172
// Auth github with octokit module
7273
const octokit = getOctokit(github_token)
73-
const run_id = core.getInput('workflow_run')
74+
const run_id = from_workflow_run
7475
? Number(context.payload.workflow_run.id)
7576
: Number(context.runId)
7677
// Fetch workflow run data
@@ -158,10 +159,10 @@ async function main(): Promise<void> {
158159
const repo_url = `<${workflow_run.repository.html_url}|*${workflow_run.repository.full_name}*>`
159160
const branch_url = `<${workflow_run.repository.html_url}/tree/${workflow_run.head_branch}|*${workflow_run.head_branch}*>`
160161
const workflow_run_url = `<${workflow_run.html_url}|#${workflow_run.run_number}>`
161-
const event_name = core.getInput('workflow_run')
162+
const event_name = from_workflow_run
162163
? context.payload.workflow_run.event
163164
: context.eventName
164-
const workflow_name = core.getInput('workflow_run')
165+
const workflow_name = from_workflow_run
165166
? context.payload.workflow_run.name
166167
: context.workflow
167168
// Example: Success: AnthonyKinson's `push` on `master` for pull_request

0 commit comments

Comments
 (0)