Skip to content

Commit

Permalink
Merge pull request #8 from notificationapi-com/s1N2rr1F/2737-new-chan…
Browse files Browse the repository at this point in the history
…nels-for-failure-and-success-github-actions

S1 n2rr1 f/2737 new channels for failure and success GitHub actions
  • Loading branch information
GreyNewfie authored Jan 24, 2025
2 parents 7d789f2 + 333b197 commit a9fcf56
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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') }}
Expand All @@ -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 }}

4 changes: 2 additions & 2 deletions .github/workflows/pullRequests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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') }}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a9fcf56

Please sign in to comment.