Skip to content

Commit

Permalink
remove default channel (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickycodes committed May 9, 2024
1 parent 2f74132 commit 2490387
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ inputs:
channel:
description: 'The Slack channel to post in'
required: false
default: 'metamask-dev'

runs:
using: 'composite'
Expand Down Expand Up @@ -70,7 +69,7 @@ runs:
echo "FINAL_TEXT=$FINAL_TEXT" >> "$GITHUB_OUTPUT"
- name: Post to a Slack channel
id: slack
if: inputs.slack-webhook-url != ''
if: ${{ inputs.slack-webhook-url != '' && inputs.channel != '' }}
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844
with:
payload: |
Expand All @@ -80,6 +79,17 @@ runs:
"username": "${{ inputs.username }}",
"channel": "#${{ inputs.channel }}"
}
- name: Post to a default Slack channel
id: slack
if: ${{ inputs.slack-webhook-url != '' && inputs.channel == '' }}
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844
with:
payload: |
{
"text": "${{ steps.final-text.outputs.FINAL_TEXT }}",
"icon_url": "${{ inputs.icon-url }}",
"username": "${{ inputs.username }}"
}
env:
SLACK_WEBHOOK_URL: ${{ inputs.slack-webhook-url }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
Expand Down

0 comments on commit 2490387

Please sign in to comment.