Skip to content

Update README.md

Update README.md #30

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 last commit
id: last_commit
run: echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Generate commit comparison URL
id: commit_comparison_url
run: |
repo_name="${{ github.repository }}"
last_commit="${{ steps.last_commit.outputs.commit_sha }}"
echo "https://github.com/${repo_name}/commit/${last_commit}"
echo "comparison_url=https://github.com/${repo_name}/commit/${last_commit}" >> $GITHUB_OUTPUT
- name: Send Slack notification
run: |
curl -X POST -H 'Content-type: application/json' --data '{
"Message": "${{ steps.commit_comparison_url.outputs.comparison_url }}",
"Assignee": "U05GG8NJF7U",
"Origin_Repo": "'"${{ github.repository }}"'"
}' "${{ secrets.SLACK_WEBHOOK_URL }}"