GitHub action for notifying to slack when pushed or merged to the repository.
Gitstory means Git + History
😅
Create a slack app and get the webhook url.
Add the webhook url to your repository secrets.
Create a workflow file in your repository.
name: Slack Notification
on:
push:
branches:
- '**' # all branches
pull_request:
branches:
- '**' # all branches
jobs:
slack_notification:
runs-on: ubuntu-latest
steps:
# checkout the repository
- name: Checkout
uses: actions/checkout@v4
with:
# fetch all history(you can adjust the depth)
fetch-depth: 0
# gitstory uses .git directory for commit history
sparse-checkout: '.git'
- name: Notify to slack
uses: importamt/[email protected]
env:
# set your timezone
TZ: Asia/Seoul
# set secret in the GitHub setting repository settings
WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
BEFORE_REF: ${{ github.event.before }}
Push the workflow file to the repository.
Check the slack when pushed or merged to the repository.
MIT