From 958cdf4fee9f1dc4d58b58e648dcec7788896e51 Mon Sep 17 00:00:00 2001 From: Steve Gill Date: Mon, 17 May 2021 13:41:53 -0700 Subject: [PATCH] v1.11.0 --- .github/workflows/customJson.yml | 2 +- .github/workflows/main.yml | 2 +- dist/index.js | 11 +++++++++-- index.js | 3 ++- package.json | 2 +- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/customJson.yml b/.github/workflows/customJson.yml index b9255fa..880f4ca 100644 --- a/.github/workflows/customJson.yml +++ b/.github/workflows/customJson.yml @@ -7,7 +7,7 @@ jobs: steps: - name: Publish to slack id: slack - uses: slackapi/slack-github-action@v1.10.0 + uses: slackapi/slack-github-action@v1.11.0 with: payload: "{\"key\":\"value\",\"foo\":\"bar\"}" env: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 24e3e80..376c86b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ jobs: steps: - name: Publish to slack id: slack - uses: slackapi/slack-github-action@v1.10.0 + uses: slackapi/slack-github-action@v1.11.0 with: channel-id: 'CTAAHRA79' slack-message: 'posting from a github action!' diff --git a/dist/index.js b/dist/index.js index b0a639a..f29206f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -16071,6 +16071,7 @@ try { try { // confirm it is valid json payload = JSON.parse(payload); + console.log('vaid json') } catch (e) { // passed in payload wasn't valid json console.error("passed in payload was invalid") @@ -16100,7 +16101,10 @@ try { } } - if (webhookUrl.length > 0) { + console.log('webhookURL type', typeof webhookUrl) + if (typeof webhookUrl !== undefined) { + // && webhookUrl.length > 0 + console.log('flattening'); // send flat payload to webhookUrl const flatPayload = flatten(payload); @@ -16110,15 +16114,18 @@ try { flatPayload[key] = '' + flatPayload[key]; }) + console.log('flattened Payload'); console.log(flatPayload); + console.log('sending webhook') axios.post(webhookUrl, flatPayload) } const time = (new Date()).toTimeString(); core.setOutput("time", time); - } catch (error) { +} catch (error) { + console.log('error in big try') core.setFailed(error.message); } diff --git a/index.js b/index.js index 51fe7c6..e0b1c55 100644 --- a/index.js +++ b/index.js @@ -80,6 +80,7 @@ try { const time = (new Date()).toTimeString(); core.setOutput("time", time); - } catch (error) { +} catch (error) { + console.log('error in big try') core.setFailed(error.message); } diff --git a/package.json b/package.json index 918b80f..03ce58b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "slack-github-action", - "version": "1.10.0", + "version": "1.11.0", "description": "The official slack github action. Use this to send data into your Slack workspace", "main": "dist/index.js", "scripts": {