diff --git a/__tests__/utils.spec.js b/__tests__/utils.spec.js index 8ca71a94..7c5b48c2 100644 --- a/__tests__/utils.spec.js +++ b/__tests__/utils.spec.js @@ -33,19 +33,9 @@ describe('Utils', () => { it('links to the action workflow', () => { const attachments = buildSlackAttachments({ status: 'STARTED', color: 'good', github: GITHUB_PUSH_EVENT }); - expect(attachments[0].fields.find(a => a.title === 'Workflow')).toEqual({ - title: 'Workflow', - value: ``, - short: true, - }); - }); - - it('links to the action job', () => { - const attachments = buildSlackAttachments({ status: 'STARTED', color: 'good', github: GITHUB_PUSH_EVENT }); - - expect(attachments[0].fields.find(a => a.title === 'Job')).toEqual({ - title: 'Job', - value: ``, + expect(attachments[0].fields.find(a => a.title === 'Action')).toEqual({ + title: 'Action', + value: ``, short: true, }); }); @@ -75,9 +65,9 @@ describe('Utils', () => { it('links to the action workflow', () => { const attachments = buildSlackAttachments({ status: 'STARTED', color: 'good', github: GITHUB_PR_EVENT }); - expect(attachments[0].fields.find(a => a.title === 'Workflow')).toEqual({ - title: 'Workflow', - value: ``, + expect(attachments[0].fields.find(a => a.title === 'Action')).toEqual({ + title: 'Action', + value: ``, short: true, }); }); diff --git a/dist/index.js b/dist/index.js index 0ac13812..3fc3c9e4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -10002,7 +10002,7 @@ module.exports = resolveCommand; const { context } = __webpack_require__(469); function buildSlackAttachments({ status, color, github }) { - const { payload, ref, workflow, eventName, job, runId } = github.context; + const { payload, ref, workflow, eventName } = github.context; const { owner, repo } = context.repo; const event = eventName; const branch = event === 'pull_request' ? payload.pull_request.head.ref : ref.replace('refs/heads/', ''); @@ -10027,13 +10027,8 @@ function buildSlackAttachments({ status, color, github }) { color, fields: [ { - title: 'Workflow', - value: ``, - short: true, - }, - { - title: 'Job', - value: ``, + title: 'Action', + value: ``, short: true, }, { @@ -18432,4 +18427,4 @@ RetryOperation.prototype.mainError = function() { /***/ }) -/******/ }); \ No newline at end of file +/******/ }); diff --git a/fixtures.js b/fixtures.js index dff1e9d4..db97e326 100644 --- a/fixtures.js +++ b/fixtures.js @@ -14,8 +14,6 @@ export const GITHUB_PUSH_EVENT = { workflow: 'CI', eventName: 'push', sha: 'abc123', - job: 'build and push', - runId: 12345, }, }; @@ -35,7 +33,5 @@ export const GITHUB_PR_EVENT = { workflow: 'CI', eventName: 'pull_request', sha: 'abc123', - job: 'build and push', - runId: 12345, }, }; diff --git a/src/utils.js b/src/utils.js index e614f890..419ad24d 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,7 +1,7 @@ const { context } = require('@actions/github'); function buildSlackAttachments({ status, color, github }) { - const { payload, ref, workflow, eventName, job, runId } = github.context; + const { payload, ref, workflow, eventName } = github.context; const { owner, repo } = context.repo; const event = eventName; const branch = event === 'pull_request' ? payload.pull_request.head.ref : ref.replace('refs/heads/', ''); @@ -26,13 +26,8 @@ function buildSlackAttachments({ status, color, github }) { color, fields: [ { - title: 'Workflow', - value: ``, - short: true, - }, - { - title: 'Job', - value: ``, + title: 'Action', + value: ``, short: true, }, {