diff --git a/action.yml b/action.yml index 553078e..2512dc3 100644 --- a/action.yml +++ b/action.yml @@ -25,7 +25,6 @@ inputs: channel: description: 'The Slack channel to post in' required: false - default: 'metamask-dev' runs: using: 'composite' @@ -56,7 +55,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: | @@ -66,6 +65,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