-
Notifications
You must be signed in to change notification settings - Fork 77
53 lines (47 loc) · 1.25 KB
/
lint-license.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
53
name: Auto License Lint
on:
pull_request:
paths:
- '**.go'
- '**.sh'
push:
branches:
- main
paths:
- '**.go'
- '**.sh'
workflow_dispatch:
inputs:
ref:
description: 'sha, ref, branch'
required: true
default: main
permissions: read-all
# for each pr, queue all workflows
# concurrency:
# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.after }}
# cancel-in-progress: true
jobs:
go-mod:
runs-on: ubuntu-latest
steps:
- name: Checking Ref
id: version
shell: bash
run: |
if ${{ github.event_name == 'workflow_dispatch' }}; then
tag_name=${{ github.event.inputs.ref }}
echo "ref=${tag_name}" >> $GITHUB_ENV
elif ${{ github.event_name == 'push' }} ; then
echo "ref=${{ github.sha }}" >> $GITHUB_ENV
else
echo "ref=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
fi
- name: Checkout Source Code
uses: actions/checkout@v4
with:
persist-credentials: false
ref: ${{ env.ref }}
- name: Check License Header
id: checklicense
uses: apache/[email protected]