From b9c29ab467e231df98ca0bf8b0a290e82094d12e Mon Sep 17 00:00:00 2001 From: Steve Gill Date: Wed, 2 Dec 2020 10:29:17 -0800 Subject: [PATCH] updates to readme --- .github/maintainers_guide.md | 7 ++-- README.md | 34 +++++++++++++++++-- .../Bot token post to channel/main.yml | 15 ++++++++ example-workflows/Workflow builder /main.yml | 12 +++++++ 4 files changed, 63 insertions(+), 5 deletions(-) create mode 100644 example-workflows/Bot token post to channel/main.yml create mode 100644 example-workflows/Workflow builder /main.yml diff --git a/.github/maintainers_guide.md b/.github/maintainers_guide.md index fd32f22..42d173b 100644 --- a/.github/maintainers_guide.md +++ b/.github/maintainers_guide.md @@ -21,8 +21,11 @@ TODO ### Releasing -TODO - +* Bundle the dependencies by running `npm run build` +* Update the version in `package.json` +* Commit the changes +* Create a git tag for the new version. Should be in the format `v1.4.0`. `git tag v1.4.0` +* Push changes up to GitHub `git push origin main --tags` ## Workflow diff --git a/README.md b/README.md index 4de5d7d..c074760 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,33 @@ -# slack-github-action +# Slack GitHub Action -Send a github payload to Slack's workflow builder. This package also accepts a BotToken from Slack to post a message to specific channel or person in Slack. +Send data into Slack using this GitHub Action! This package has two different techniques to send data to Slack: -test \ No newline at end of file +1) Send data to Slack's Workflow Builder (requires a paid Slack instance). +2) Send data via a Slack app to post to a specific channel (use an existing custom app or create a new one). + +## Slack Workflow Builder Route + +### Usage + +``` +- name: Send data to Slack workflow + id: slack + uses: slackapi/slack-github-action@v1.4.0 + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} +``` + +## Slack App Route + +### Usage + +``` +- name: Post to a Slack channel + id: slack + uses: slackapi/slack-github-action@v1.4.0 + with: + channel-id: 'CHANNEL_ID' # Slack channel id to post message + slack-message: 'posting from a github action!' + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} +``` \ No newline at end of file diff --git a/example-workflows/Bot token post to channel/main.yml b/example-workflows/Bot token post to channel/main.yml new file mode 100644 index 0000000..1127b53 --- /dev/null +++ b/example-workflows/Bot token post to channel/main.yml @@ -0,0 +1,15 @@ +on: [push] + +jobs: + new_push_job: + runs-on: ubuntu-latest + name: New push to repo + steps: + - name: Publish to slack channel via bot token + id: slack + uses: slackapi/slack-github-action@v1.4.0 + with: + channel-id: 'SLACK_CHANNEL_ID' # ID of Slack Channel you want to post to + slack-message: 'posting from a github action!' # The message you want to post + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} diff --git a/example-workflows/Workflow builder /main.yml b/example-workflows/Workflow builder /main.yml new file mode 100644 index 0000000..631fe31 --- /dev/null +++ b/example-workflows/Workflow builder /main.yml @@ -0,0 +1,12 @@ +on: [push] + +jobs: + new_push_job: + runs-on: ubuntu-latest + name: New push to repo + steps: + - name: Send data to Slack Workflow Builder + id: slack + uses: slackapi/slack-github-action@v1.4.0 + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}