Skip to content

Commit 74f2f2e

Browse files
authored
Update build.yaml
fix slack
1 parent a95441f commit 74f2f2e

File tree

1 file changed

+15
-27
lines changed

1 file changed

+15
-27
lines changed

.github/workflows/build.yaml

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -41,31 +41,19 @@ jobs:
4141
- if: ${{ always() }}
4242
uses: slackapi/[email protected]
4343
with:
44-
channel-id: github
44+
method: chat.postMessage
45+
token: ${{ secrets.SLACK_BOT_TOKEN }}
4546
payload: |
46-
{
47-
"attachments": [
48-
{
49-
"color": "${{ job.status == 'success' && 'good' || 'danger' }}",
50-
"title": "${{ github.repository }}",
51-
"title_link": "https://github.com/${{ github.repository }}",
52-
"text": "docker build image result",
53-
"fields": [
54-
{
55-
"title": "Image",
56-
"value": "<https://hub.docker.com/r/${{ env.IMAGE_NAME }}|${{ env.IMAGE_NAME }}>",
57-
"short": true
58-
},
59-
{
60-
"title": "Status",
61-
"value": "${{ job.status }}",
62-
"short": true
63-
}
64-
],
65-
"footer": "Github Actions",
66-
"footer_icon": "https://github.githubassets.com/favicon.ico"
67-
}
68-
]
69-
}
70-
env:
71-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
47+
channel: github
48+
text: "docker build image result: <https://github.com/${{ github.repository }}|${{ github.repository }}>"
49+
attachments:
50+
- color: "${{ job.status == 'success' && 'good' || 'danger' }}"
51+
fields:
52+
- title: "Image"
53+
short: true
54+
value: "<https://hub.docker.com/r/${{ env.IMAGE_NAME }}|${{ env.IMAGE_NAME }}>"
55+
- title: "Status"
56+
short: true
57+
value: "${{ job.status }}"
58+
footer: "Github Actions"
59+
footer_icon: "https://github.githubassets.com/favicon.ico"

0 commit comments

Comments
 (0)