v1.8.0
customJson.yml / New push to repo (push) Successful in 2s
main.yml / New push to repo (push) Failing after 2s
customJson.yml / New push to repo (push) Successful in 2s
main.yml / New push to repo (push) Failing after 2s
This commit is contained in:
@@ -7,7 +7,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Publish to slack
|
- name: Publish to slack
|
||||||
id: slack
|
id: slack
|
||||||
uses: slackapi/slack-github-action@v1.7.0
|
uses: slackapi/slack-github-action@v1.8.0
|
||||||
with:
|
with:
|
||||||
payload: "{\"key\":\"value\",\"foo\":\"bar\"}"
|
payload: "{\"key\":\"value\",\"foo\":\"bar\"}"
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -7,13 +7,13 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Publish to slack
|
- name: Publish to slack
|
||||||
id: slack
|
id: slack
|
||||||
uses: slackapi/slack-github-action@v1.7.0
|
uses: slackapi/slack-github-action@v1.8.0
|
||||||
with:
|
with:
|
||||||
channel-id: 'CTAAHRA79'
|
channel-id: 'CTAAHRA79'
|
||||||
slack-message: 'posting from a github action!'
|
slack-message: 'posting from a github action!'
|
||||||
env:
|
env:
|
||||||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
||||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||||
|
|
||||||
# Use the output from the `hello` step
|
# Use the output from the `hello` step
|
||||||
- name: Get the output time
|
- name: Get the output time
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ try {
|
|||||||
try {
|
try {
|
||||||
// confirm it is valid json
|
// confirm it is valid json
|
||||||
payload = JSON.parse(payload);
|
payload = JSON.parse(payload);
|
||||||
|
console.log('vaid json')
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// passed in payload wasn't valid json
|
// passed in payload wasn't valid json
|
||||||
console.error("passed in payload was invalid")
|
console.error("passed in payload was invalid")
|
||||||
@@ -57,6 +58,7 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (webhookUrl.length > 0) {
|
if (webhookUrl.length > 0) {
|
||||||
|
console.log('flattening');
|
||||||
// send flat payload to webhookUrl
|
// send flat payload to webhookUrl
|
||||||
const flatPayload = flatten(payload);
|
const flatPayload = flatten(payload);
|
||||||
|
|
||||||
@@ -66,8 +68,10 @@ try {
|
|||||||
flatPayload[key] = '' + flatPayload[key];
|
flatPayload[key] = '' + flatPayload[key];
|
||||||
})
|
})
|
||||||
|
|
||||||
|
console.log('flattened Payload');
|
||||||
console.log(flatPayload);
|
console.log(flatPayload);
|
||||||
|
|
||||||
|
console.log('sending webhook')
|
||||||
axios.post(webhookUrl, flatPayload)
|
axios.post(webhookUrl, flatPayload)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "slack-github-action",
|
"name": "slack-github-action",
|
||||||
"version": "1.7.0",
|
"version": "1.8.0",
|
||||||
"description": "The official slack github action. Use this to send data into your Slack workspace",
|
"description": "The official slack github action. Use this to send data into your Slack workspace",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user