Skip to content

Instantly share code, notes, and snippets.

@smd877
Created January 13, 2021 09:23
Show Gist options
  • Save smd877/d05baac3060a4b405d4120fbcf1f7291 to your computer and use it in GitHub Desktop.
Save smd877/d05baac3060a4b405d4120fbcf1f7291 to your computer and use it in GitHub Desktop.
Slackにファイルアップロードするシェルスクリプト(送信チャンネルとトークンは環境変数に入れておく)
#!/bin/sh
if [ $# -ne 1 ]; then
echo "Params error."
exit 1
fi
curl -F file=@$1 -F channels=$POST_SLACK_CHANNEL_ID -H "Authorization: Bearer $POST_SLACK_TOKEN_ID" https://slack.com/api/files.upload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment