diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c2e7d08..5f5dcda4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,10 +43,12 @@ jobs: - name: yarn build run: yarn build - name: release + if: ${{ endsWith(github.ref, '/main') }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: npx semantic-release - name: update v1 tag + if: ${{ endsWith(github.ref, '/main') }} run: 'git push -f https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:refs/heads/v1' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/__tests__/utils.spec.js b/__tests__/utils.spec.js index ede84f02..fe5bea01 100644 --- a/__tests__/utils.spec.js +++ b/__tests__/utils.spec.js @@ -1,7 +1,6 @@ import { formatChannelName, buildSlackAttachments } from '../src/utils'; import { GITHUB_PUSH_EVENT, GITHUB_PR_EVENT } from '../fixtures'; const runId = parseInt(process.env.GITHUB_RUN_ID, 10); -const job = process.env.GITHUB_JOB; describe('Utils', () => { describe('formatChannelName', () => { @@ -42,12 +41,12 @@ describe('Utils', () => { }); }); - it('links to the action job', () => { + it('links to the action repo', () => { 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 === 'Repo')).toEqual({ + title: 'Repo', + value: ``, short: true, }); }); diff --git a/dist/index.js b/dist/index.js index 9e949af4..bb42a213 100644 --- a/dist/index.js +++ b/dist/index.js @@ -10008,7 +10008,6 @@ function buildSlackAttachments({ status, color, github }) { const branch = event === 'pull_request' ? payload.pull_request.head.ref : ref.replace('refs/heads/', ''); const sha = event === 'pull_request' ? payload.pull_request.head.sha : github.context.sha; - const job = process.env.GITHUB_JOB; const runId = parseInt(process.env.GITHUB_RUN_ID, 10); const referenceLink = @@ -10029,13 +10028,13 @@ function buildSlackAttachments({ status, color, github }) { color, fields: [ { - title: 'Workflow', - value: ``, + title: 'Repo', + value: ``, short: true, }, { - title: 'Job', - value: ``, + title: 'Workflow', + value: ``, short: true, }, { diff --git a/src/utils.js b/src/utils.js index b0724e0c..3faabd10 100644 --- a/src/utils.js +++ b/src/utils.js @@ -7,7 +7,6 @@ function buildSlackAttachments({ status, color, github }) { const branch = event === 'pull_request' ? payload.pull_request.head.ref : ref.replace('refs/heads/', ''); const sha = event === 'pull_request' ? payload.pull_request.head.sha : github.context.sha; - const job = process.env.GITHUB_JOB; const runId = parseInt(process.env.GITHUB_RUN_ID, 10); const referenceLink = @@ -28,13 +27,13 @@ function buildSlackAttachments({ status, color, github }) { color, fields: [ { - title: 'Workflow', - value: ``, + title: 'Repo', + value: ``, short: true, }, { - title: 'Job', - value: ``, + title: 'Workflow', + value: ``, short: true, }, {