forked from eclipse-iofog/edgelet
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (40 loc) · 1.51 KB
/
Copy pathcodeql.yml
File metadata and controls
49 lines (40 loc) · 1.51 KB
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
name: CodeQL
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
permissions: read-all
env:
GO_VERSION: '1.26.6'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
# Required to upload SARIF to the code-scanning dashboard.
security-events: write
actions: read
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Initialize CodeQL
uses: github/codeql-action/init@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
with:
languages: go
- name: Set up Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: go.sum
- name: Autobuild
uses: github/codeql-action/autobuild@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
with:
category: "/language:go"
# Fork PRs (e.g. Datasance/edgelet → eclipse-iofog/edgelet) get a read-only
# GITHUB_TOKEN; upload fails with "Resource not accessible by integration".
# Analysis still runs; SARIF uploads on same-repo push/PR and post-merge push.
upload: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}