https://github.com/opspresso/action-slack
https://github.com/opspresso/action-slack
github-actions slack
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/opspresso/action-slack
- Owner: opspresso
- License: gpl-3.0
- Created: 2019-09-20T04:55:49.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-06-05T09:20:46.000Z (about 6 years ago)
- Last Synced: 2026-04-15T04:05:10.424Z (2 months ago)
- Topics: github-actions, slack
- Language: Shell
- Homepage:
- Size: 40 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Post Slack
[](https://github.com/opspresso/action-slack/actions)
[](https://github.com/opspresso/action-slack/releases)
## Usage
```yaml
name: Post Slack
on: push
jobs:
slack:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Post to Slack
uses: opspresso/action-slack@master
env:
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
JSON_PATH: ./target/slack_message.json
```
## env
Name | Description | Default | Required
---- | ----------- | ------- | --------
SLACK_TOKEN | Your Slack WeebHook Token. | | **Yes**
JSON_PATH | The json file path of the slack message. [see](https://api.slack.com/incoming-webhooks) | | **Yes**
## exec
```bash
URL="https://hooks.slack.com/services/${SLACK_TOKEN}"
curl \
-sSL \
-X POST \
-H "Content-type: application/json" \
--data @"${JSON_PATH}"
```