Merge pull request #344 from wp-media/fix/exclude-renew-and-upgrade-f… #6
This file contains hidden or 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 Slack on config change | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| jobs: | |
| notify-on-change: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 # Need current and previous commit | |
| - name: Check if wp.config.sample.ts changed | |
| id: check | |
| run: | | |
| if git diff --name-only HEAD~1 HEAD | grep -q '^config/wp\.config\.sample\.ts$'; then | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Send Slack notification | |
| if: steps.check.outputs.changed == 'true' | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| run: | | |
| curl -X POST -H 'Content-type: application/json' \ | |
| --data "{\"text\":\"⚠️ wp.config.sample.ts changed on develop in $GITHUB_REPOSITORY (commit: ${GITHUB_SHA:0:7})\"}" \ | |
| "$SLACK_WEBHOOK_URL" |