From 2d3fbb8c2f6474fdf3f979f5abc678caafc32bee Mon Sep 17 00:00:00 2001 From: Andras Csizmadia Date: Wed, 3 Jan 2024 16:25:12 +0100 Subject: [PATCH] Added slack notification to github workflow --- .github/workflows/ci.yml | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a99d22..6002dc1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,7 @@ # Copyright (c) 2023-present VPMedia # author: Andras Csizmadia -name: Node.js CI +name: Continuous Integration on: push: @@ -11,21 +11,30 @@ on: jobs: build: - runs-on: ubuntu-22.04 - strategy: matrix: node-version: [20.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: npm ci - - run: npm run lint - - run: npm test + cache: "npm" + - name: Init + run: npm ci + - name: Lint + run: npm run lint + - name: Test + run: npm run test + - name: Slack notification + # https://github.com/slackapi/slack-github-action + id: slack + uses: slackapi/slack-github-action@v1.24.0 + with: + channel-id: "dev-github" + slack-message: "${{ github.repository }}\n${{ github.workflow }} workflow is ${{ job.status }}\nRef: ${{ github.ref }}\nURL: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}" + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + if: always()