go install github.com/ToshihitoKon/slack-quickpost@latest
make Slack App and get OAuth token.
jobs:
using-slack-quikpost:
runs-on: ubuntu-latest
steps:
- uses: ToshihitoKon/slack-quickpost@v1
with:
version: 0.8.0
OAuth token given by one of the following methods.
export SLACK_TOKEN="xoxb-XXXXXXXX-XXXXXXX-XXXXXX"
slack-quickpost \
--channel [CHANNEL_ID] \
--text [TEXT]
slack-quickpost \
--token xoxb-XXXXXXXX-XXXXXXX-XXXXXX \
--channel [CHANNEL_ID] \
--text [TEXT]
Save config yaml ~/.config/slack-quickpost/profile-name.yaml
token: xoxb-XXX
channel: XXX
Provide the profile name using an environment variable(SLACK_QUICKPOST_PROFILE
) or option.
SLACK_QUICKPOST_PROFILE=profile-name slack-quickpost --text [TEXT]
slack-quickpost --profile profile-name --text [TEXT]
slack-quickpost \
--channel [CANNEL_ID] \
--text [TEXT] \
--username [DISPLAY_USERNAME] \
--icon [ICON_EMOJI]
# text given textfile path and icon given image url
slack-quickpost \
--channel [CANNEL_ID] \
--textfile [FIlEPATH] \
--username [DISPLAY_USERNAME] \
--icon_url [ICON_IMAGE_URL]
# post text as snippet
slack-quickpost \
--channel [CANNEL_ID] \
--text [TEXT] \
--snippet
# post BlockKit
slack-quickpost \
--channel [CANNEL_ID] \
--block '{"type":"section","text":{"type":"mrkdwn","text":"*Sample BlockKit"}}'
slack-quickpost \
--channel [CANNEL_ID] \
--file [FILE_PATH]
--blocks string post BlockKit json
--channel string post slack channel id
--file string post file path
--icon string icon emoji
--icon-url string icon image url
--nofail always return success code(0)
--profile string slack quickpost profile name
--snippet post text as snippet
--text string post text
--textfile string post text file path
--thread-ts string post under thread
--token string slack app OAuth token
--username string user name
--version print version