diff --git a/.github/workflows/TestFail.yml b/.github/workflows/TestFail.yml deleted file mode 100644 index 03612c4..0000000 --- a/.github/workflows/TestFail.yml +++ /dev/null @@ -1,17 +0,0 @@ -on: [push] - -jobs: - new_push_job: - runs-on: ubuntu-latest - name: New push to repo - steps: - - name: Should Fail - id: slack - uses: slackapi/slack-github-action@v1.13.0 - with: - channel-id: 'CTAAHRA79' - slack-message: 'posting from a github action!' - - # Use the output from the `hello` step - - name: Get the output time - run: echo "The time was ${{ steps.hello.outputs.time }}" diff --git a/.github/workflows/botPostMessage.yml b/.github/workflows/botPostMessage.yml index b73c771..61eace7 100644 --- a/.github/workflows/botPostMessage.yml +++ b/.github/workflows/botPostMessage.yml @@ -7,7 +7,7 @@ jobs: steps: - name: Publish to slack id: slack - uses: slackapi/slack-github-action@v1.13.0 + uses: slackapi/slack-github-action@v1.14.0 with: channel-id: 'CTAAHRA79' slack-message: 'posting from a github action!' diff --git a/.github/workflows/webhookCustomJSON.yml b/.github/workflows/webhookCustomJSON.yml index f0bc15f..8ec57a7 100644 --- a/.github/workflows/webhookCustomJSON.yml +++ b/.github/workflows/webhookCustomJSON.yml @@ -7,7 +7,7 @@ jobs: steps: - name: Publish to slack id: slack - uses: slackapi/slack-github-action@v1.13.0 + uses: slackapi/slack-github-action@v1.14.0 with: payload: "{\"key\":\"value\",\"foo\":\"bar\"}" env: diff --git a/README.md b/README.md index 5e49b6b..fe8c2a8 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ You need to define expected variables in the payload the webhook will receive. I ``` - name: Send GitHub Action trigger data to Slack workflow id: slack - uses: slackapi/slack-github-action@v1.13.0 + uses: slackapi/slack-github-action@v1.14.0 env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} ``` @@ -35,7 +35,7 @@ or ``` - name: Send custom JSON data to Slack workflow id: slack - uses: slackapi/slack-github-action@v1.13.0 + uses: slackapi/slack-github-action@v1.14.0 with: payload: "{\"key\":\"value\",\"foo\":\"bar\"}" # This data can be any valid JSON from a previous step in the GitHub Action env: @@ -57,7 +57,7 @@ This route allows ``` - name: Post to a Slack channel id: slack - uses: slackapi/slack-github-action@v1.4.0 + uses: slackapi/slack-github-action@v1.14.0 with: channel-id: 'CHANNEL_ID' # Slack channel id to post message slack-message: 'posting from a github action!' diff --git a/dist/index.js b/dist/index.js index 517947c..d434ab9 100644 --- a/dist/index.js +++ b/dist/index.js @@ -16057,7 +16057,7 @@ try { throw 'Need to provide at least one botToken or webhookUrl' } - if (botToken.length > 0) { + if (typeof botToken !== 'undefined' && botToken.length > 0) { const message = core.getInput('slack-message'); const channelId = core.getInput('channel-id'); const web = new WebClient(botToken); diff --git a/example-workflows/Bot token post to channel/main.yml b/example-workflows/Bot token post to channel/main.yml index 050cf84..4b1ec17 100644 --- a/example-workflows/Bot token post to channel/main.yml +++ b/example-workflows/Bot token post to channel/main.yml @@ -7,7 +7,7 @@ jobs: steps: - name: Publish to slack channel via bot token id: slack - uses: slackapi/slack-github-action@v1.13.0 + uses: slackapi/slack-github-action@v1.14.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 diff --git a/example-workflows/Workflow builder/customJSONPayload.yml b/example-workflows/Workflow builder/customJSONPayload.yml index b26c400..f116341 100644 --- a/example-workflows/Workflow builder/customJSONPayload.yml +++ b/example-workflows/Workflow builder/customJSONPayload.yml @@ -7,7 +7,7 @@ jobs: steps: - name: Send GitHub trigger payload to Slack Workflow Builder id: slack - uses: slackapi/slack-github-action@v1.13.0 + uses: slackapi/slack-github-action@v1.14.0 with: payload: "{\"key\":\"value\",\"foo\":\"bar\"}" env: diff --git a/example-workflows/Workflow builder/githubTriggerPayload.yml b/example-workflows/Workflow builder/githubTriggerPayload.yml index a1ba1c2..69d4d43 100644 --- a/example-workflows/Workflow builder/githubTriggerPayload.yml +++ b/example-workflows/Workflow builder/githubTriggerPayload.yml @@ -7,6 +7,6 @@ jobs: steps: - name: Send GitHub trigger payload to Slack Workflow Builder id: slack - uses: slackapi/slack-github-action@v1.13.0 + uses: slackapi/slack-github-action@v1.14.0 env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/index.js b/index.js index 5d4a6c1..982b464 100644 --- a/index.js +++ b/index.js @@ -13,7 +13,7 @@ try { throw 'Need to provide at least one botToken or webhookUrl' } - if (botToken.length > 0) { + if (typeof botToken !== 'undefined' && botToken.length > 0) { const message = core.getInput('slack-message'); const channelId = core.getInput('channel-id'); const web = new WebClient(botToken); diff --git a/package.json b/package.json index 4c1e999..aa018f5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "slack-github-action", - "version": "1.13.0", + "version": "1.14.0", "description": "The official slack github action. Use this to send data into your Slack workspace", "main": "dist/index.js", "scripts": {