GitHub Action to push action events to Slack workflow.
-
First you need to create GitHub Action secret called
SLACK_WEBHOOK_URL
. This secret value should be valid Slack webhook url. For more info please check this link. -
If you haven't already done so, create a
.github/workflows
folder in your repository (this is where your actions will live). -
Now create a
.github/workflows/slack-notification-on-pr-merge.yml
file with these contents:
name: Notify on PR merge without approvals
on:
pull_request:
types: [ closed ]
branches:
- main
jobs:
slack_notification:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.merged && github.event.pull_request.reviews.total_count == 0 }}
steps:
- name: Send Slack Notification
uses: respond-io/[email protected]
with:
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
As general, this Github action also use ncc to package the code in to single js file. So in the development please globally install ncc first.
npm i -g @vercel/ncc --save
After your development, please execute following command for building the package file, then push the code to GitHub.
npm run build