https://github.com/hasithaishere/slack-connector-action
GitHub Action to push action events to Slack workflow.
https://github.com/hasithaishere/slack-connector-action
Last synced: over 1 year ago
JSON representation
GitHub Action to push action events to Slack workflow.
- Host: GitHub
- URL: https://github.com/hasithaishere/slack-connector-action
- Owner: hasithaishere
- License: mit
- Created: 2023-05-11T08:56:01.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-11T10:04:02.000Z (about 3 years ago)
- Last Synced: 2025-01-07T12:47:35.626Z (over 1 year ago)
- Language: JavaScript
- Size: 212 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Slack Connector Action
GitHub Action to push action events to Slack workflow.
## Setting up this action
1. 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](https://api.slack.com/messaging/webhooks).
2. If you haven't already done so, create a `.github/workflows` folder in your
repository (_this is where your actions will live_).
3. Now create a `.github/workflows/slack-notification-on-pr-merge.yml` file with these contents:
``` yaml
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: hasithaishere/slack-connector-action@vmain
with:
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
```
## For Maintainers
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.
```sh
npm i -g @vercel/ncc --save
```
After your development, please execute following command for building the package file, then push the code to GitHub.
```sh
npm run build
```
## Developers
- [Hasitha Gamage](hasitha@rocketbots.io)