Skip to content

Instantly share code, notes, and snippets.

@hjdarnel
Created January 30, 2020 22:36
Show Gist options
  • Save hjdarnel/037910a14de07e6b71b9343ddc510cf4 to your computer and use it in GitHub Desktop.
Save hjdarnel/037910a14de07e6b71b9343ddc510cf4 to your computer and use it in GitHub Desktop.
Slack myself standup from the current day (for tomorrow's reference)
# Send a Slack message to any channel with your commits from the previous 24 hours
# add this to crontab -e
# requires legacy token https://api.slack.com/custom-integrations/legacy-tokens
# requires channel id replacement
# requires git standup to be installed https://github.com/kamranahmedse/git-standup
#!/bin/sh
cd /Users/henry
standup=$(git standup -m 3 -s -D local | sed -e 's/<Henry Darnell>//g' -e 's/\/Users\/henry\///g')
curl -X POST -H 'Authorization: Bearer ---REDACTED LEGACY TOKEN---' \
-H 'Content-type: application/json;charset=utf-8' \
-d "{\"channel\":\"---REDACTED CHANNEL ID---\",\"text\":\"Hello! :simple_smile: Your standup for tomorrow:\n\`\`\`$standup\`\`\`\"}" \
-s https://slack.com/api/chat.postMessage > /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment