Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix link to workflow filter view #243

Merged
merged 2 commits into from Jul 2, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion __tests__/blocks.test.ts
Expand Up @@ -155,7 +155,7 @@ test('custom config of slack action using legacy and blocks', async () => {
fields: [
{
type: 'mrkdwn',
text: '*Workflow*\n<https://github.com/act10ns/slack/actions?query=build-test|build-test>'
text: '*Workflow*\n<https://github.com/act10ns/slack/actions?query=workflow:build-test|build-test>'
},
{type: 'mrkdwn', text: '*Git Ref*\nmaster (branch)'},
{type: 'mrkdwn', text: '*Run ID*\n<https://github.com/act10ns/slack/actions/runs/100143423|100143423>'},
Expand Down
2 changes: 1 addition & 1 deletion __tests__/config.test.ts
Expand Up @@ -127,7 +127,7 @@ test('custom config of slack action using legacy attachments', async () => {
{
short: true,
title: 'Workflow',
value: '<https://github.com/act10ns/slack/actions?query=build-test|build-test>'
value: '<https://github.com/act10ns/slack/actions?query=workflow:build-test|build-test>'
},
{
short: true,
Expand Down
2 changes: 1 addition & 1 deletion __tests__/fixtures/slack.json
Expand Up @@ -15,7 +15,7 @@
"author_link": "https://github.com/satterly",
"author_icon": "https://avatars0.githubusercontent.com/u/615057?v=4",
"title": "",
"text": "*<https://github.com/act10ns/slack/actions?query=build-test|Workflow _build-test_ job _CI Tests_ triggered by _push_ is _failure_>* for <https://github.com/act10ns/slack/commits/master|`master`>\n<https://github.com/act10ns/slack/compare/db9fe60430a6...68d48876e079|`68d48876`> - 4 commits",
"text": "*<https://github.com/act10ns/slack/actions?query=workflow:build-test|Workflow _build-test_ job _CI Tests_ triggered by _push_ is _failure_>* for <https://github.com/act10ns/slack/commits/master|`master`>\n<https://github.com/act10ns/slack/compare/db9fe60430a6...68d48876e079|`68d48876`> - 4 commits",
"fields": [
{
"title": "Job Steps",
Expand Down
2 changes: 1 addition & 1 deletion __tests__/inputs.test.ts
Expand Up @@ -120,7 +120,7 @@ test('custom config of slack action using inputs for channel and message', async
{
short: true,
title: 'Workflow',
value: '<https://github.com/act10ns/slack/actions?query=build-test|build-test>'
value: '<https://github.com/act10ns/slack/actions?query=workflow:build-test|build-test>'
},
{
short: true,
Expand Down
2 changes: 1 addition & 1 deletion __tests__/job_status.test.ts
Expand Up @@ -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: '*<https://github.com/act10ns/slack/actions?query=build-test|Workflow _build-test_ job _CI Tests_ triggered by _push_ is _failure_>* for <https://github.com/act10ns/slack/commits/master|`master`>\n<https://github.com/act10ns/slack/compare/db9fe60430a6...68d48876e079|`68d48876`> - 4 commits',
text: '*<https://github.com/act10ns/slack/actions?query=workflow:build-test|Workflow _build-test_ job _CI Tests_ triggered by _push_ is _failure_>* for <https://github.com/act10ns/slack/commits/master|`master`>\n<https://github.com/act10ns/slack/compare/db9fe60430a6...68d48876e079|`68d48876`> - 4 commits',
title: '',
fields: [
{
Expand Down
2 changes: 1 addition & 1 deletion __tests__/pull_request.test.ts
Expand Up @@ -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: '*<https://github.com/act10ns/slack/actions?query=build-test|Workflow _build-test_ job _Build and Test_ triggered by _pull_request_ is _Success_>* for <https://github.com/act10ns/slack/pull/17|`#17`>\n<https://github.com/act10ns/slack/pull/17/files|`rename-to-slack`> - Rename to slack',
text: '*<https://github.com/act10ns/slack/actions?query=workflow:build-test|Workflow _build-test_ job _Build and Test_ triggered by _pull_request_ is _Success_>* for <https://github.com/act10ns/slack/pull/17|`#17`>\n<https://github.com/act10ns/slack/pull/17/files|`rename-to-slack`> - Rename to slack',
title: '',
fields: [],
footer: '<https://github.com/act10ns/slack|act10ns/slack> #760',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/push.test.ts
Expand Up @@ -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: '*<https://github.com/act10ns/slack/actions?query=build-test|Workflow _build-test_ job _Build and Test_ triggered by _push_ is _Success_>* for <https://github.com/act10ns/slack/commits/master|`master`>\n<https://github.com/act10ns/slack/compare/db9fe60430a6...68d48876e079|`68d48876`> - 4 commits',
text: '*<https://github.com/act10ns/slack/actions?query=workflow:build-test|Workflow _build-test_ job _Build and Test_ triggered by _push_ is _Success_>* for <https://github.com/act10ns/slack/commits/master|`master`>\n<https://github.com/act10ns/slack/compare/db9fe60430a6...68d48876e079|`68d48876`> - 4 commits',
title: '',
fields: [],
footer: '<https://github.com/act10ns/slack|act10ns/slack> #8',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/release.test.ts
Expand Up @@ -72,7 +72,7 @@ test('release event to slack', async () => {
author_icon: '',
mrkdwn_in: ['pretext', 'text', 'fields'],
pretext: '',
text: '*<https://github.com/act10ns/slack/actions?query=build-test|Workflow _build-test_ job _Build and Test_ triggered by _release_ is _Success_>* for <https://github.com/act10ns/slack/commits/refs/tags/v1.0.13|`refs/tags/v1.0.13`>\n',
text: '*<https://github.com/act10ns/slack/actions?query=workflow:build-test|Workflow _build-test_ job _Build and Test_ triggered by _release_ is _Success_>* for <https://github.com/act10ns/slack/commits/refs/tags/v1.0.13|`refs/tags/v1.0.13`>\n',
title: '',
fields: [],
footer: '<https://github.com/act10ns/slack|act10ns/slack> #817',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/schedule.test.ts
Expand Up @@ -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: '*<https://github.com/act10ns/slack/actions?query=schedule-test|Workflow _schedule-test_ job _Build and Test_ triggered by _schedule_ is _Success_>* for <https://github.com/act10ns/slack/commits/master|`master`>\n<https://github.com/act10ns/slack/commit/09a6b2c9|`09a6b2c9`> - Schedule `*/15 * * * *`',
text: '*<https://github.com/act10ns/slack/actions?query=workflow:schedule-test|Workflow _schedule-test_ job _Build and Test_ triggered by _schedule_ is _Success_>* for <https://github.com/act10ns/slack/commits/master|`master`>\n<https://github.com/act10ns/slack/commit/09a6b2c9|`09a6b2c9`> - Schedule `*/15 * * * *`',
title: '',
fields: [],
footer: '<https://github.com/act10ns/slack|act10ns/slack> #179',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/workflow_dispatch.test.ts
Expand Up @@ -70,7 +70,7 @@ test('workflow_dispatch event to slack', async () => {
author_icon: '',
mrkdwn_in: ['pretext', 'text', 'fields'],
pretext: '',
text: '*<https://github.com/act10ns/slack/actions?query=manual-test|Workflow _manual-test_ job _Build and Test_ triggered by _workflow_dispatch_ is _Success_>* for <https://github.com/act10ns/slack/commits/master|`master`>\n',
text: '*<https://github.com/act10ns/slack/actions?query=workflow:manual-test|Workflow _manual-test_ job _Build and Test_ triggered by _workflow_dispatch_ is _Success_>* for <https://github.com/act10ns/slack/commits/master|`master`>\n',
title: '',
fields: [],
footer: '<https://github.com/act10ns/slack|act10ns/slack> #6',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/workflow_run.test.ts
Expand Up @@ -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: '*<https://github.com/act10ns/slack/actions?query=workflow-run|Workflow _workflow-run_ job _on-success_ triggered by _workflow_run_ is _SUCCESS_>* for <https://github.com/act10ns/slack/commits/master|`master`>\n',
text: '*<https://github.com/act10ns/slack/actions?query=workflow:workflow-run|Workflow _workflow-run_ job _on-success_ triggered by _workflow_run_ is _SUCCESS_>* for <https://github.com/act10ns/slack/commits/master|`master`>\n',
fields: [],
fallback: '[GitHub] workflow-run #4 is SUCCESS',
footer: '<https://github.com/act10ns/slack|act10ns/slack> workflow-run #4',
Expand Down
2 changes: 1 addition & 1 deletion src/slack.ts
Expand Up @@ -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
Expand Down