diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 46a5d8e..58c8031 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -8,7 +8,7 @@ jobs: name: Test & Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup Node uses: actions/setup-node@v4 @@ -17,7 +17,7 @@ jobs: - name: Cache node_modules id: cache-modules - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: node_modules key: 18.x-${{ runner.OS }}-build-${{ hashFiles('package.json') }} @@ -44,13 +44,25 @@ jobs: with: token: ${{ secrets.NPM_AUTH_TOKEN }} - - name: Send Slack notification + - name: Send Slack notification for Success + if: steps.publish.outputs.type != 'none' && success() uses: 8398a7/action-slack@v3 with: status: ${{ job.status }} - fields: repo + fields: repo,message,commit,workflow,took text: Published to NPM ${{ steps.publish.outputs.old-version }} -> ${{ steps.publish.outputs.version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - if: steps.publish.outputs.type != 'none' && always() + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_SUCCESS_WEBHOOK_URL }} + + - name: Send Slack notification for Failure + if: steps.publish.outputs.type != 'none' && (failure() || cancelled()) + uses: 8398a7/action-slack@v3 + with: + status: ${{ job.status }} + fields: repo,message,commit,workflow,took + text: Published to NPM ${{ steps.publish.outputs.old-version }} -> ${{ steps.publish.outputs.version }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_FAILED_WEBHOOK_URL }} + diff --git a/.github/workflows/pullRequests.yml b/.github/workflows/pullRequests.yml index 377e391..996c244 100644 --- a/.github/workflows/pullRequests.yml +++ b/.github/workflows/pullRequests.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Node uses: actions/setup-node@v4 @@ -19,7 +19,7 @@ jobs: - name: Cache node_modules id: cache-modules - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: node_modules key: 18.x-${{ runner.OS }}-build-${{ hashFiles('package.json') }} diff --git a/package-lock.json b/package-lock.json index 62cb16c..dd9f17d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@notificationapi/core", - "version": "0.0.10", + "version": "0.0.12", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@notificationapi/core", - "version": "0.0.10", + "version": "0.0.12", "devDependencies": { "@types/jest": "^29.5.3", "@types/node": "^20.14.10",