-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (40 loc) · 1.23 KB
/
cicd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: "Github to Slack Notification"
on:
push:
branches: [ "main" ]
jobs:
job1:
runs-on: ubuntu-latest
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
steps:
# Notify Slack when the workflow starts
- uses: act10ns/slack@v2
with:
status: starting
channel: '#github-to-slack-notification'
message: "Checking npm packages"
if: always()
# Checkout the repository
- name: Checkout Code
uses: actions/checkout@v3
# Install npm dependencies
- name: Install Dependencies
run: npm install
# Check for outdated packages and save output
- name: Check Outdated Packages
id: outdated-packages
run: |
npm outdated || echo "No outdated packages found" > outdated_packages.txt
cat outdated_packages.txt
continue-on-error: true
# Read the output and send it to Slack
- name: Notify Slack - Outdated Packages
uses: act10ns/slack@v2
with:
status: success
channel: '#github-to-slack-notification'
message: |
Following outdated packages found:
```$(cat outdated_packages.txt)```
if: always()