Update README.md #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "::set-output name=author::$(git log -1 --pretty=format:'%an')" | |
- name: Get changed content | |
id: changed_content | |
run: echo "::set-output name=content::$(git diff HEAD^ README.md | tail -n +5)" | |
- name: Run Python script | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
run: | | |
python send_slack_notification.py "${{ steps.changed_content.outputs.content }}" "${{ steps.commit_author.outputs.author }}" "${{ github.repository }}" "${{ secrets.SLACK_WEBHOOK_URL }}" |