Skip to content

Commit 2945f88

Browse files
Retire Travis (#49)
1 parent e2add4b commit 2945f88

File tree

3 files changed

+88
-10
lines changed

3 files changed

+88
-10
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
icon_emoji: ':octocat:',
7777
mention: 'channel',
7878
attachments: [{
79-
title: '${{ steps.commit.outputs.repo }} ${{ github.workflow }} pipeline has failed',
79+
title: '[${{ steps.commit.outputs.repo }}] ${{ github.workflow }} pipeline has failed',
8080
color: '${{ steps.check.outputs.status }}' == 'failure' ? 'danger' : 'warning',
8181
fields: [{
8282
title: 'Commit Hash',

.github/workflows/fossa.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Fossa
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
defaults:
9+
run:
10+
shell: bash
11+
12+
env:
13+
FOSSA_VER: 1.1.0
14+
FOSSA_URL: https://github.com/fossas/fossa-cli/releases/download
15+
GOLANG_VERSION: 1.15
16+
17+
jobs:
18+
19+
scan:
20+
name: Fossa
21+
runs-on: ubuntu-18.04
22+
steps:
23+
- name: Checkout Repository
24+
uses: actions/checkout@v2
25+
- name: Setup Golang Environment
26+
uses: actions/setup-go@v2
27+
with:
28+
go-version: '${{ env.GOLANG_VERSION }}'
29+
- name: Configure Fossa CLI
30+
run: |
31+
wget ${{ env.FOSSA_URL }}/v${{ env.FOSSA_VER }}/fossa-cli_${{ env.FOSSA_VER }}_linux_amd64.tar.gz
32+
tar xzf fossa-cli_${{ env.FOSSA_VER }}_linux_amd64.tar.gz
33+
./fossa init
34+
- name: Run License Scan
35+
env:
36+
FOSSA_API_KEY: ${{ secrets.FOSSA_TOKEN }}
37+
GO111MODULE: on
38+
GOPATH: /home/runner/go
39+
run: ./fossa analyze -t ${GITHUB_REPOSITORY#*/} -b ${GITHUB_REF##*/}
40+
41+
notify:
42+
name: Notify
43+
runs-on: ubuntu-18.04
44+
needs: scan
45+
if: always()
46+
steps:
47+
- name: Workflow Status
48+
id: check
49+
uses: martialonline/workflow-status@v1
50+
- name: Output Variables
51+
id: commit
52+
run: |
53+
echo "::set-output name=sha::$(echo ${GITHUB_SHA} | cut -c1-7)"
54+
echo "::set-output name=repo::${GITHUB_REPOSITORY#*/}"
55+
- name: Send Notification
56+
uses: 8398a7/action-slack@v3
57+
if: steps.check.outputs.status == 'failure'
58+
with:
59+
status: custom
60+
custom_payload: |
61+
{
62+
username: 'Fossa Scan',
63+
icon_emoji: ':fossa:',
64+
mention: 'channel',
65+
attachments: [{
66+
title: '[${{ steps.commit.outputs.repo }}] ${{ github.workflow }} license scan has failed',
67+
color: 'danger',
68+
fields: [{
69+
title: 'Commit Hash',
70+
value: '${{ steps.commit.outputs.sha }}',
71+
short: true
72+
},
73+
{
74+
title: 'Author',
75+
value: '${{ github.actor }}',
76+
short: true
77+
},
78+
{
79+
title: 'Job URL',
80+
value: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}',
81+
short: false
82+
}]
83+
}]
84+
}
85+
env:
86+
GITHUB_TOKEN: ${{ github.token }}
87+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

.travis.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)