forked from telepresenceio/telepresence
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (50 loc) · 1.67 KB
/
licenses.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: "License verification"
on:
pull_request:
jobs:
dependency_info_linux:
name: "Linux: Verify use of forbidden licenses"
runs-on: ubuntu-latest
outputs:
is-up-to-date: ${{ steps.check.outputs.up-to-date }}
diff: ${{ steps.check.outputs.diff }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: "${{ github.event.pull_request.head.sha }}"
- uses: actions/setup-go@v2
with:
go-version: '1.17'
- name: "Generate dependency information"
shell: bash
run: make generate
- name: "Check dependency files are up-to-date"
id: check
shell: bash
run: |
set -e
git add .
if [[ -n "$(git status --porcelain)" ]]; then
echo '::set-output name=diff::'$(PAGER= git diff --cached 2>&1 | base64 -w0)
echo "::set-output name=up-to-date::no"
else
echo "::set-output name=up-to-date::yes"
fi
up_to_date_check_linux:
name: "Linux: Check out-of-date licenses"
needs: dependency_info_linux
runs-on: ubuntu-latest
steps:
- name: "Check dependency files are up-to-date"
shell: bash
run: |
set -e
if [[ "${{needs.dependency_info_linux.outputs.is-up-to-date}}" == "no" ]]; then
echo '::error:: Changes detected after dependency generation. Run ' \
'`make generate` and commit the latest version of the ' \
'dependency information files'
echo ${{needs.dependency_info_linux.outputs.diff}} | base64 -d
exit 1
fi
echo '::info:: Files are up-to-date'