-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (56 loc) · 1.82 KB
/
ci-code-approval.yml
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: "Code Approval"
on:
merge_group:
workflow_dispatch:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
types:
- opened
- reopened
- synchronize # source branch updated
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
golang-ci-lint:
name: Golangci-lint
runs-on: ubuntu-latest
steps:
# Sets up golang
- uses: actions/setup-go@v5
with:
go-version: ${{ vars.GO_VERSION }}
cache-dependency-path: "**/*.sum"
- name: Checkout repository
uses: actions/checkout@v4
- name: "Configure git for private modules"
env:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: git config --global url."https://x:${GITHUB_API_TOKEN}@github.com".insteadOf "https://github.com"
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
only-new-issues: true
args: --verbose --timeout 5m
code-approval:
name: "Code Approval"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ vars.GO_VERSION }}
cache-dependency-path: "**/*.sum"
- name: "Configure git for private modules"
env:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: git config --global url."https://x:${GITHUB_API_TOKEN}@github.com".insteadOf "https://github.com"
- name: Make
run: make pr-approval