An open API service indexing awesome lists of open source software.

https://github.com/opspresso/action-slack


https://github.com/opspresso/action-slack

github-actions slack

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

          

# Post Slack

[![GitHub Actions status](https://github.com/opspresso/action-slack/workflows/Build-Push/badge.svg)](https://github.com/opspresso/action-slack/actions)
[![GitHub Releases](https://img.shields.io/github/release/opspresso/action-slack.svg)](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}"
```