Skip to content

Commit 0319536

Browse files
ci: changes needed by v2.0.0 of slack github action
1 parent 87016c1 commit 0319536

File tree

1 file changed

+30
-45
lines changed

1 file changed

+30
-45
lines changed

.github/workflows/trivy.yml

Lines changed: 30 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Scheduled Trivy Scan
22
on:
33
workflow_dispatch:
44
schedule:
5-
- cron: '0 10 * * 1'
5+
- cron: "0 10 * * 1"
66

77
jobs:
88
trivy:
@@ -23,15 +23,15 @@ jobs:
2323
with:
2424
image-ref: ghcr.io/nrkno/sofie-core-${{ matrix.image }}:latest
2525
format: json
26-
output: '${{ matrix.image }}-trivy-scan-results.json'
26+
output: "${{ matrix.image }}-trivy-scan-results.json"
2727

2828
- name: Run Trivy vulnerability scanner (table)
2929
uses: aquasecurity/[email protected]
3030
env:
3131
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
3232
with:
3333
image-ref: ghcr.io/nrkno/sofie-core-${{ matrix.image }}:latest
34-
output: '${{ matrix.image }}-trivy-scan-results.txt'
34+
output: "${{ matrix.image }}-trivy-scan-results.txt"
3535

3636
- name: Post all scan results to Github Summary as a table
3737
env:
@@ -48,8 +48,8 @@ jobs:
4848
env:
4949
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
5050
with:
51-
format: 'github'
52-
output: 'dependency-results-${{ matrix.image }}.sbom.json'
51+
format: "github"
52+
output: "dependency-results-${{ matrix.image }}.sbom.json"
5353
image-ref: ghcr.io/nrkno/sofie-core-${{ matrix.image }}:latest
5454
github-pat: ${{ secrets.GITHUB_TOKEN }}
5555

@@ -66,44 +66,29 @@ jobs:
6666
- name: Send Slack Notification
6767
uses: slackapi/[email protected]
6868
with:
69+
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
70+
webhook-type: incoming-webhook
6971
payload: |
70-
{
71-
"text": "Trivy scan results",
72-
"blocks": [
73-
{
74-
"type": "header",
75-
"text": {
76-
"type": "plain_text",
77-
"text": "Trivy scan results for sofie-core-${{ matrix.image }}:latest"
78-
}
79-
},
80-
{
81-
"type": "section",
82-
"text": {
83-
"type": "mrkdwn",
84-
"text": ":thisisfine: ${{ env.SUMMARY }}"
85-
}
86-
},
87-
{
88-
"type": "section",
89-
"text": {
90-
"type": "mrkdwn",
91-
"text": "Read the full scan results on Github"
92-
},
93-
"accessory": {
94-
"type": "button",
95-
"text": {
96-
"type": "plain_text",
97-
"text": ":github: Scan results",
98-
"emoji": true
99-
},
100-
"value": "workflow_run",
101-
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
102-
"action_id": "button-action"
103-
}
104-
}
105-
]
106-
}
107-
env:
108-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
109-
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
72+
text: "Trivy scan results"
73+
blocks:
74+
- type: "header"
75+
text:
76+
type: "plain_text"
77+
text: "Trivy scan results for sofie-core-${{ matrix.image }}:latest"
78+
- type: "section"
79+
text:
80+
type: "mrkdwn"
81+
text: ":thisisfine: ${{ env.SUMMARY }}"
82+
- type: "section"
83+
text:
84+
type: "mrkdwn"
85+
text: "Read the full scan results on Github"
86+
accessory:
87+
type: "button"
88+
text:
89+
type: "plain_text"
90+
text: ":github: Scan results"
91+
emoji: true
92+
value: "workflow_run"
93+
url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
94+
action_id: "button-action"

0 commit comments

Comments
 (0)