Skip to content

Commit

Permalink
Merge pull request #6 from archive/fix-warning
Browse files Browse the repository at this point in the history
Fixed #3 - Warning for optional slack parameters
  • Loading branch information
archive committed Aug 30, 2020
2 parents 0d2ae0e + b9d6b02 commit 67903bc
Show file tree
Hide file tree
Showing 10 changed files with 1,366 additions and 1,331 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Sends a message to Slack when a push, a pull request or an issue is made
steps:
- name: Send message to Slack API
uses: archive/github-actions-slack@v1.0.0
uses: archive/github-actions-slack@master
with:
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_USER_OAUTH_ACCESS_TOKEN }}
slack-channel: test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/slack-notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ jobs:
with:
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_USER_OAUTH_ACCESS_TOKEN }}
slack-channel: test
slack-text: Hello! Event "${{ github.event_name }}" in "${{ github.repository }}" 🤓
slack-text: Hello! Event *${{ github.event_name }}* in *${{ github.repository }}* 🤓
- name: Result from "Send Message"
run: echo "The result was ${{ steps.notify.outputs.slack-result }}"
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,17 @@ It was a good way to learn more about Github Actions
### Why should I use this?

This action is just an HTTPS POST to Slack API, so you can easily build this by yourself, or use this, or use any other action available on the marketplace :)

## Development and testing

See package.json for `yarn lint`, `yarn test`, etc.

Remember to create the dist with `yarn build`.

To run local integration test (from this repository):

```
env BOT_USER_OAUTH_ACCESS_TOKEN=<YOUR TOKEN> CHANNEL=<YOUR CHANNEL> TEXT="Test" node integration-test/end-to-end.js
```

To debug action and see what payload is being sent to slack, enable debugging: https://docs.github.com/en/actions/configuring-and-managing-workflows/managing-a-workflow-run#enabling-debug-logging
40 changes: 38 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,44 @@ inputs:
slack-text:
description: "Text"
required: true
slack-optional-x:
description: "Optional arguments"
slack-optional-as_user:
description: "https://api.slack.com/methods/chat.postMessage#arg_as_user"
required: false
slack-optional-attachments:
description: "https://api.slack.com/methods/chat.postMessage#arg_attachments"
required: false
slack-optional-blocks:
description: "https://api.slack.com/methods/chat.postMessage#arg_blocks"
required: false
slack-optional-icon_emoji:
description: "https://api.slack.com/methods/chat.postMessage#arg_icon_emoji"
required: false
slack-optional-icon_url:
description: "https://api.slack.com/methods/chat.postMessage#arg_icon_url"
required: false
slack-optional-link_names:
description: "https://api.slack.com/methods/chat.postMessage#arg_link_names"
required: false
slack-optional-mrkdwn:
description: "https://api.slack.com/methods/chat.postMessage#arg_mrkdwn"
required: false
slack-optional-parse:
description: "https://api.slack.com/methods/chat.postMessage#arg_parse"
required: false
slack-optional-reply_broadcast:
description: "https://api.slack.com/methods/chat.postMessage#arg_reply_broadcast"
required: false
slack-optional-thread_ts:
description: "https://api.slack.com/methods/chat.postMessage#arg_thread_ts"
required: false
slack-optional-unfurl_links:
description: "https://api.slack.com/methods/chat.postMessage#arg_unfurl_links"
required: false
slack-optional-unfurl_media:
description: "https://api.slack.com/methods/chat.postMessage#arg_unfurl_media"
required: false
slack-optional-username:
description: "https://api.slack.com/methods/chat.postMessage#arg_username"
required: false
outputs:
slack-result:
Expand Down
Loading

0 comments on commit 67903bc

Please sign in to comment.