Delete assets/Solace_Logo_Green.png #2
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: Trigger Zap on Main Branch Merge | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| trigger-webhook: | |
| runs-on: ubuntu-latest | |
| # Only run this workflow if the repository is public | |
| if: github.event.repository.private == false | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 2 # To get the commit message from the last commit | |
| - name: Get commit message | |
| id: get_commit_message | |
| run: | | |
| COMMIT_MESSAGE=$(git log -1 --pretty=format:%B) | |
| COMMIT_MESSAGE="${COMMIT_MESSAGE//'%'/'%25'}" | |
| COMMIT_MESSAGE="${COMMIT_MESSAGE//$'\n'/'%0A'}" | |
| COMMIT_MESSAGE="${COMMIT_MESSAGE//$'\r'/'%0D'}" | |
| echo "::set-output name=message::$COMMIT_MESSAGE" | |
| # For newer GitHub Actions: | |
| echo "message=$COMMIT_MESSAGE" >> $GITHUB_OUTPUT | |
| - name: Send webhook | |
| uses: distributhor/workflow-webhook@v3 | |
| with: | |
| webhook_url: ${{ secrets.ZAPIER_TWEET_URL }} | |
| webhook_secret: ${{ secrets.ZAPIER_TWEET_URL_SECRET }} | |
| data: '{"commit_message": "${{ steps.get_commit_message.outputs.message }}"}' | |
| content_type: application/json |