From fca7d4a01f7b996cf19b7be1957ce4294103410e Mon Sep 17 00:00:00 2001 From: Nick Satterly Date: Fri, 1 Jul 2022 23:01:54 +0200 Subject: [PATCH 1/2] Fix link to workflow filter view Fixes #227 --- src/slack.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slack.ts b/src/slack.ts index 59f173df..d2d19f71 100644 --- a/src/slack.ts +++ b/src/slack.ts @@ -143,7 +143,7 @@ export async function send( const runId = process.env.GITHUB_RUN_ID const runNumber = process.env.GITHUB_RUN_NUMBER - const workflowUrl = `${repositoryUrl}/actions?query=${workflow}` + const workflowUrl = `${repositoryUrl}/actions?query=workflow:${workflow}` const workflowRunUrl = `${repositoryUrl}/actions/runs/${runId}` const sha = process.env.GITHUB_SHA as string From 4e8d564a2119a4eb3f3e7050d36a2206defa4a36 Mon Sep 17 00:00:00 2001 From: Nick Satterly Date: Sat, 2 Jul 2022 14:41:22 +0200 Subject: [PATCH 2/2] Fix tests for workflow link url query param --- __tests__/blocks.test.ts | 2 +- __tests__/config.test.ts | 2 +- __tests__/fixtures/slack.json | 2 +- __tests__/inputs.test.ts | 2 +- __tests__/job_status.test.ts | 2 +- __tests__/pull_request.test.ts | 2 +- __tests__/push.test.ts | 2 +- __tests__/release.test.ts | 2 +- __tests__/schedule.test.ts | 2 +- __tests__/workflow_dispatch.test.ts | 2 +- __tests__/workflow_run.test.ts | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/__tests__/blocks.test.ts b/__tests__/blocks.test.ts index b3b741f9..ffb4c236 100644 --- a/__tests__/blocks.test.ts +++ b/__tests__/blocks.test.ts @@ -155,7 +155,7 @@ test('custom config of slack action using legacy and blocks', async () => { fields: [ { type: 'mrkdwn', - text: '*Workflow*\n' + text: '*Workflow*\n' }, {type: 'mrkdwn', text: '*Git Ref*\nmaster (branch)'}, {type: 'mrkdwn', text: '*Run ID*\n'}, diff --git a/__tests__/config.test.ts b/__tests__/config.test.ts index 967ba47c..78bb45f7 100644 --- a/__tests__/config.test.ts +++ b/__tests__/config.test.ts @@ -127,7 +127,7 @@ test('custom config of slack action using legacy attachments', async () => { { short: true, title: 'Workflow', - value: '' + value: '' }, { short: true, diff --git a/__tests__/fixtures/slack.json b/__tests__/fixtures/slack.json index 50416d51..dda07f6d 100644 --- a/__tests__/fixtures/slack.json +++ b/__tests__/fixtures/slack.json @@ -15,7 +15,7 @@ "author_link": "https://github.com/satterly", "author_icon": "https://avatars0.githubusercontent.com/u/615057?v=4", "title": "", - "text": "** for \n - 4 commits", + "text": "** for \n - 4 commits", "fields": [ { "title": "Job Steps", diff --git a/__tests__/inputs.test.ts b/__tests__/inputs.test.ts index fb5ba306..4cc518cb 100644 --- a/__tests__/inputs.test.ts +++ b/__tests__/inputs.test.ts @@ -120,7 +120,7 @@ test('custom config of slack action using inputs for channel and message', async { short: true, title: 'Workflow', - value: '' + value: '' }, { short: true, diff --git a/__tests__/job_status.test.ts b/__tests__/job_status.test.ts index 6f4137f6..0712b123 100644 --- a/__tests__/job_status.test.ts +++ b/__tests__/job_status.test.ts @@ -102,7 +102,7 @@ test('push event to slack', async () => { author_icon: 'https://avatars0.githubusercontent.com/u/615057?v=4', mrkdwn_in: ['pretext', 'text', 'fields'], pretext: '', - text: '** for \n - 4 commits', + text: '** for \n - 4 commits', title: '', fields: [ { diff --git a/__tests__/pull_request.test.ts b/__tests__/pull_request.test.ts index 6799c1e2..7b6e24a1 100644 --- a/__tests__/pull_request.test.ts +++ b/__tests__/pull_request.test.ts @@ -69,7 +69,7 @@ test('pull request event to slack', async () => { author_icon: 'https://avatars0.githubusercontent.com/u/615057?v=4', mrkdwn_in: ['pretext', 'text', 'fields'], pretext: '', - text: '** for \n - Rename to slack', + text: '** for \n - Rename to slack', title: '', fields: [], footer: ' #760', diff --git a/__tests__/push.test.ts b/__tests__/push.test.ts index c8839d54..00c19bbb 100644 --- a/__tests__/push.test.ts +++ b/__tests__/push.test.ts @@ -69,7 +69,7 @@ test('push event to slack', async () => { author_icon: 'https://avatars0.githubusercontent.com/u/615057?v=4', mrkdwn_in: ['pretext', 'text', 'fields'], pretext: '', - text: '** for \n - 4 commits', + text: '** for \n - 4 commits', title: '', fields: [], footer: ' #8', diff --git a/__tests__/release.test.ts b/__tests__/release.test.ts index 5e271732..8bec9f4c 100644 --- a/__tests__/release.test.ts +++ b/__tests__/release.test.ts @@ -72,7 +72,7 @@ test('release event to slack', async () => { author_icon: '', mrkdwn_in: ['pretext', 'text', 'fields'], pretext: '', - text: '** for \n', + text: '** for \n', title: '', fields: [], footer: ' #817', diff --git a/__tests__/schedule.test.ts b/__tests__/schedule.test.ts index 76c8695f..2871af84 100644 --- a/__tests__/schedule.test.ts +++ b/__tests__/schedule.test.ts @@ -65,7 +65,7 @@ test('schedule event to slack', async () => { author_icon: 'https://avatars1.githubusercontent.com/u/9919?s=200&v=4', mrkdwn_in: ['pretext', 'text', 'fields'], pretext: '', - text: '** for \n - Schedule `*/15 * * * *`', + text: '** for \n - Schedule `*/15 * * * *`', title: '', fields: [], footer: ' #179', diff --git a/__tests__/workflow_dispatch.test.ts b/__tests__/workflow_dispatch.test.ts index b9f70639..1991620a 100644 --- a/__tests__/workflow_dispatch.test.ts +++ b/__tests__/workflow_dispatch.test.ts @@ -70,7 +70,7 @@ test('workflow_dispatch event to slack', async () => { author_icon: '', mrkdwn_in: ['pretext', 'text', 'fields'], pretext: '', - text: '** for \n', + text: '** for \n', title: '', fields: [], footer: ' #6', diff --git a/__tests__/workflow_run.test.ts b/__tests__/workflow_run.test.ts index 9e3ca47c..f533a589 100644 --- a/__tests__/workflow_run.test.ts +++ b/__tests__/workflow_run.test.ts @@ -83,7 +83,7 @@ test('workflow_run event to slack', async () => { author_icon: 'https://avatars.githubusercontent.com/u/615057?v=4', title: 'GitHub Actions', title_link: 'https://support.github.com', - text: '** for \n', + text: '** for \n', fields: [], fallback: '[GitHub] workflow-run #4 is SUCCESS', footer: ' workflow-run #4',