From a9900b4aebe52a208717a6de3f04671212b8af3b Mon Sep 17 00:00:00 2001 From: Steve Gill Date: Thu, 13 May 2021 17:08:16 -0700 Subject: [PATCH] updated to v1.7.0 --- .github/workflows/customJson.yml | 2 +- .github/workflows/main.yml | 2 +- dist/index.js | 5 +++-- index.js | 5 +++-- package.json | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/customJson.yml b/.github/workflows/customJson.yml index d15902c..31cad47 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.6.0 + uses: slackapi/slack-github-action@v1.7.0 with: payload: '{key: "value", foo: "bar"}' env: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9ec573b..e12b1e3 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.6.0 + uses: slackapi/slack-github-action@v1.7.0 with: channel-id: 'CTAAHRA79' slack-message: 'posting from a github action!' diff --git a/dist/index.js b/dist/index.js index fa523b0..b0a639a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -16059,14 +16059,15 @@ try { let payload = core.getInput('payload'); console.log('payload:') console.log(payload) - console.log(typeof payload) + console.log(typeof payload, payload.length) - if (payload.length > 0) { + if (payload.length < 1) { console.log('undefined payload'); console.log('no payload passed in, using payload that triggered the GitHub Action') // Get the JSON webhook payload for the event that triggered the workflow payload = github.context.payload; } else { + console.log('in else') try { // confirm it is valid json payload = JSON.parse(payload); diff --git a/index.js b/index.js index 9a0e485..720a34c 100644 --- a/index.js +++ b/index.js @@ -15,14 +15,15 @@ try { let payload = core.getInput('payload'); console.log('payload:') console.log(payload) - console.log(typeof payload) + console.log(typeof payload, payload.length) - if (payload.length > 0) { + if (payload.length < 1) { console.log('undefined payload'); console.log('no payload passed in, using payload that triggered the GitHub Action') // Get the JSON webhook payload for the event that triggered the workflow payload = github.context.payload; } else { + console.log('in else') try { // confirm it is valid json payload = JSON.parse(payload); diff --git a/package.json b/package.json index ffe1a7a..adaca6b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "slack-github-action", - "version": "1.6.0", + "version": "1.7.0", "description": "The official slack github action. Use this to send data into your Slack workspace", "main": "dist/index.js", "scripts": {