Skip to content
This repository was archived by the owner on May 24, 2023. It is now read-only.

Commit 958b660

Browse files
authored
Use Fossa action in the workflow (#99)
1 parent 092a306 commit 958b660

File tree

2 files changed

+71
-1
lines changed

2 files changed

+71
-1
lines changed

.github/workflows/fossa.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Fossa
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths-ignore:
8+
- '**.md'
9+
- 'LICENSE'
10+
11+
jobs:
12+
13+
scan:
14+
name: Fossa
15+
runs-on: ubuntu-20.04
16+
steps:
17+
- name: Checkout Repository
18+
uses: actions/checkout@v2
19+
- name: Scan
20+
uses: fossas/fossa-action@v1
21+
with:
22+
api-key: ${{ secrets.FOSSA_TOKEN }}
23+
24+
notify:
25+
name: Notify
26+
runs-on: ubuntu-20.04
27+
needs: scan
28+
if: always()
29+
steps:
30+
- name: Workflow Status
31+
id: check
32+
uses: martialonline/workflow-status@v2
33+
- name: Output Variables
34+
id: commit
35+
run: |
36+
echo "::set-output name=sha::$(echo ${GITHUB_SHA} | cut -c1-7)"
37+
echo "::set-output name=repo::${GITHUB_REPOSITORY#*/}"
38+
- name: Send Notification
39+
uses: 8398a7/action-slack@v3
40+
if: steps.check.outputs.status == 'failure'
41+
with:
42+
status: custom
43+
custom_payload: |
44+
{
45+
username: 'Fossa Scan',
46+
icon_emoji: ':fossa:',
47+
mention: 'channel',
48+
attachments: [{
49+
title: '[${{ steps.commit.outputs.repo }}] ${{ github.workflow }} license scan has failed',
50+
color: 'danger',
51+
fields: [{
52+
title: 'Commit Hash',
53+
value: '${{ steps.commit.outputs.sha }}',
54+
short: true
55+
},
56+
{
57+
title: 'Author',
58+
value: '${{ github.actor }}',
59+
short: true
60+
},
61+
{
62+
title: 'Job URL',
63+
value: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}',
64+
short: false
65+
}]
66+
}]
67+
}
68+
env:
69+
GITHUB_TOKEN: ${{ github.token }}
70+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Continuous Integration](https://github.com/nginxinc/nginx-ingress-operator/workflows/Continuous%20Integration/badge.svg)](https://github.com/nginxinc/nginx-ingress-operator/actions)
1+
[![Continuous Integration](https://github.com/nginxinc/nginx-ingress-operator/workflows/Continuous%20Integration/badge.svg)](https://github.com/nginxinc/nginx-ingress-operator/actions) [![FOSSA Status](https://app.fossa.io/api/projects/custom%2B1062%2Fgithub.com%2Fnginxinc%2Fnginx-ingress-operator.svg?type=shield)](https://app.fossa.io/projects/custom%2B1062%2Fgithub.com%2Fnginxinc%2Fnginx-ingress-operator?ref=badge_shield)
22

33
# NGINX Ingress Operator
44

0 commit comments

Comments
 (0)