Skip to content

Commit 2177c49

Browse files
committed
chore: update GitHub workflows with permissions
1 parent 24e3e6c commit 2177c49

File tree

3 files changed

+39
-28
lines changed

3 files changed

+39
-28
lines changed

.github/workflows/codeql.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "CodeQL Analysis"
1+
name: "CodeQL"
22

33
on:
44
schedule:
@@ -7,29 +7,34 @@ on:
77

88
jobs:
99
analyze:
10-
name: CodeQL Analyze
10+
name: Analyze (${{ matrix.language }})
1111
runs-on: ubuntu-latest
12-
12+
permissions:
13+
security-events: write
14+
packages: read
15+
actions: read
16+
contents: read
1317
strategy:
1418
fail-fast: false
1519
matrix:
16-
languages:
17-
- go
20+
include:
21+
- language: actions
22+
build-mode: none
23+
- language: go
24+
build-mode: autobuild
1825

1926
steps:
20-
- name: Checkout Repository
27+
- name: Checkout repository
2128
uses: actions/checkout@v5
2229

2330
- name: Initialize CodeQL
2431
uses: github/codeql-action/init@v3
2532
with:
26-
languages: ${{ matrix.languages }}
27-
queries: security-extended, security-and-quality
28-
29-
- name: Autobuild Project
30-
uses: github/codeql-action/autobuild@v3
33+
languages: ${{ matrix.language }}
34+
build-mode: ${{ matrix.build-mode }}
35+
queries: security-extended,security-and-quality
3136

32-
- name: Run CodeQL Analysis
37+
- name: Perform CodeQL Analysis
3338
uses: github/codeql-action/analyze@v3
3439
with:
35-
category: /language:${{ matrix.languages }}
40+
category: "/language:${{matrix.language}}"

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ on:
88
jobs:
99
artifacts:
1010
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
1114
steps:
1215
- name: Checkout Repository
1316
uses: actions/checkout@v5
1417

1518
- name: Build and Tag Docker Image
16-
run: docker build --compress --file Dockerfile --force-rm --tag sentinel-official/sentinelhub .
19+
run: make build-image
1720

1821
- name: Extract Binary from Docker Image
1922
run: |

.github/workflows/test.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,35 @@ on:
88
- master
99

1010
jobs:
11-
run:
11+
go:
1212
runs-on: ubuntu-latest
13-
timeout-minutes: 30
13+
permissions:
14+
contents: read
15+
timeout-minutes: 5
16+
1417
steps:
1518
- name: Checkout Repository
1619
uses: actions/checkout@v5
1720

1821
- name: Set Up Go
1922
uses: actions/setup-go@v5
2023
with:
21-
go-version: '1.22'
24+
go-version: '1.25'
2225

2326
- name: Generate Coverage Report
2427
run: |
2528
make test-coverage
26-
filepaths=""
27-
filepaths+=" $(find ./ -type f -name '*.go' -exec grep -l 'DO NOT COVER' {} \;)"
28-
filepaths+=" $(find ./ -type f -name '*.pb.go')"
29-
filepaths+=" $(find ./ -type f -name '*.pb.gw.go')"
30-
filepaths+=" $(find ./ -type f -path '*/client/cli/*')"
31-
filepaths+=" $(find ./ -type f -path '*/expected/*')"
32-
filepaths+=" $(find ./ -type f -path '*/services/*')"
33-
for filepath in ${filepaths}; do
34-
filepath=$(echo "${filepath}" | sed 's@^[email protected]/sentinel-official/sentinelhub/v[0-9]*@g')
35-
echo "Excluding file ${filepath} from coverage report..."
36-
sed -i "/$(echo "${filepath}" | sed 's@/@\\/@g')/d" ./coverage.txt
29+
files=""
30+
files+=" $(find ./ -type f -name '*.go' -exec grep -l 'DO NOT COVER' {} \;)"
31+
files+=" $(find ./ -type f -name '*.pb.go')"
32+
files+=" $(find ./ -type f -name '*.pb.gw.go')"
33+
files+=" $(find ./ -type f -path '*/client/cli/*')"
34+
files+=" $(find ./ -type f -path '*/expected/*')"
35+
files+=" $(find ./ -type f -path '*/services/*')"
36+
for f in ${files}; do
37+
f=$(echo "${f}" | sed 's@^[email protected]/sentinel-official/sentinelhub/v[0-9]*@g')
38+
echo "Excluding file ${f} from coverage report..."
39+
sed -i "/$(echo "${f}" | sed 's@/@\\/@g')/d" ./coverage.txt
3740
done
3841
3942
- name: Upload Coverage to Codecov

0 commit comments

Comments
 (0)