trying to get the list #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |