Skip to content

Commit

Permalink
Add GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-67 committed Apr 29, 2024
1 parent bb9654a commit e0c0bff
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/slack_notification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Slack Notification on PR Merge

on:
pull_request:
types:
- closed
branches:
- 'github-workflow'

jobs:
notify_on_merge:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Extract version from package.json
id: extract_version
run: echo ::set-output name=version::$(jq -r '.version' package.json)

- name: Send message to Slack
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
curl -X POST -H 'Content-type: application/json' --data '{"text": "Version: ${{ steps.extract_version.outputs.version }}\nPR ID: ${{ github.event.pull_request.number }}"}' $SLACK_WEBHOOK_URL

0 comments on commit e0c0bff

Please sign in to comment.