Last active
November 1, 2021 17:35
-
-
Save ifnull/b83aadfc2996a9b217c0956b16624b97 to your computer and use it in GitHub Desktop.
Revisions
-
Daniel Smith revised this gist
Nov 1, 2021 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -13,9 +13,7 @@ GIT_HEAD_SHORT=${GIT_HEAD:0:9} # Create message GIT_MESSAGE="Deploy ($GIT_ORIG_HEAD_SHORT..$GIT_HEAD_SHORT):\n" GIT_MESSAGE+=\`\`\`"$(git log --pretty=format:'%h %cr %cn %Cgreen%s%Creset' ORIG_HEAD..HEAD)"\`\`\` # Send to Slack curl -s -X POST --data "payload={ \"username\": \"${SLACK_USERNAME}\", \"text\": \"${GIT_MESSAGE}\"}" ${SLACK_WEBHOOK_URL} > /dev/null -
Daniel Smith created this gist
Nov 1, 2021 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ #!/bin/sh # WARNING: Putting your git repo in your web root can be dangerous. SLACK_WEBHOOK_URL=$(git config --get hooks.slack.deploy-webhook-url) SLACK_USERNAME="Git Deploy Bot (Develop)" REPO_PATH="$(dirname ${BASH_SOURCE[0]})/.." GIT_ORIG_HEAD=$(git rev-parse ORIG_HEAD | awk '{print $1}') GIT_HEAD=$(git rev-parse HEAD | awk '{print $1}') GIT_ORIG_HEAD_SHORT=${GIT_ORIG_HEAD:0:9} GIT_HEAD_SHORT=${GIT_HEAD:0:9} # Create message GIT_MESSAGE="Deploy ($GIT_ORIG_HEAD_SHORT..$GIT_HEAD_SHORT):\n" GIT_MESSAGE+=\`\`\`"$(git log --graph --date=short ORIG_HEAD..HEAD)"\`\`\` #echo $GIT_MESSAGE # Send to Slack curl -s -X POST --data "payload={ \"username\": \"${SLACK_USERNAME}\", \"text\": \"${GIT_MESSAGE}\"}" ${SLACK_WEBHOOK_URL} > /dev/null 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ # Create an Incoming Webhooks intengration here to get a webhook URL: https://***.slack.com/apps/manage/custom-integrations git config hooks.slack.deploy-webhook-url 'https://hooks.slack.com/services/*****/*****/*****'