Skip to content

Update README.md

Update README.md #19

name: Notify on README.md update
on:
push:
paths:
- 'README.md'
jobs:
notify_on_readme_update:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get commit author
id: commit_author
run: echo "author=$(git log -1 --pretty=format:'%an')" >> $GITHUB_OUTPUT
- name: Get changed content
id: changed_content
run: |
if git show HEAD:README.md &>/dev/null; then
git show HEAD:README.md
else
echo ""
fi
- name: Send Slack notification
run: |
curl -X POST -H 'Content-type: application/json' --data '{ "Message": "'"${{ steps.changed_content.outputs.content }}"'", "Assignee": "'"${{ steps.commit_author.outputs.author }}"'", "Origin_Repo": "'"${{ github.repository }}"'" }' "${{ secrets.SLACK_WEBHOOK_URL }}"
# - name: Run Python script
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
# run: |
# python send_slack_notification.py "${{ steps.changed_content.outputs }}" "${{ steps.commit_author.outputs.author }}" "${{ github.repository }}"