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

Add workflow for Fossa #99

Merged
merged 1 commit into from
Apr 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/fossa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Fossa

on:
push:
branches:
- master
paths-ignore:
- '**.md'
- 'LICENSE'

jobs:

scan:
name: Fossa
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Scan
uses: fossas/fossa-action@v1
with:
api-key: ${{ secrets.FOSSA_TOKEN }}

notify:
name: Notify
runs-on: ubuntu-20.04
needs: scan
if: always()
steps:
- name: Workflow Status
id: check
uses: martialonline/workflow-status@v2
- name: Output Variables
id: commit
run: |
echo "::set-output name=sha::$(echo ${GITHUB_SHA} | cut -c1-7)"
echo "::set-output name=repo::${GITHUB_REPOSITORY#*/}"
- name: Send Notification
uses: 8398a7/action-slack@v3
if: steps.check.outputs.status == 'failure'
with:
status: custom
custom_payload: |
{
username: 'Fossa Scan',
icon_emoji: ':fossa:',
mention: 'channel',
attachments: [{
title: '[${{ steps.commit.outputs.repo }}] ${{ github.workflow }} license scan has failed',
color: 'danger',
fields: [{
title: 'Commit Hash',
value: '${{ steps.commit.outputs.sha }}',
short: true
},
{
title: 'Author',
value: '${{ github.actor }}',
short: true
},
{
title: 'Job URL',
value: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}',
short: false
}]
}]
}
env:
GITHUB_TOKEN: ${{ github.token }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Continuous Integration](https://github.com/nginxinc/nginx-ingress-operator/workflows/Continuous%20Integration/badge.svg)](https://github.com/nginxinc/nginx-ingress-operator/actions)
[![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)

# NGINX Ingress Operator

Expand Down