Skip to content

Commit e6226c5

Browse files
authored
fix: repair workflow permissions (CKV2_GHA_1) (#252)
* fix: repair workflow permissions (CKV2_GHA_1) ferrarimarco/dotfiles@7695d832ed4 * style: apply Prettier
1 parent c31ab46 commit e6226c5

File tree

7 files changed

+28
-12
lines changed

7 files changed

+28
-12
lines changed

.github/workflows/changelog.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
branches:
77
- main
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
build:
1114
runs-on: ubuntu-latest
@@ -87,4 +90,3 @@ jobs:
8790
with:
8891
github_token: ${{ secrets.GITHUB_TOKEN || secrets.PAT }}
8992
branch: ${{ github.ref }}
90-
...

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ on:
1010
# │ │ ┌───── day of the month (1 - 31)
1111
# │ │ │ ┌─── month (1 - 12 or JAN-DEC)
1212
# │ │ │ │ ┌─ day of the week (0 - 6 or SUN-SAT)
13-
- cron: '30 1 * * 0'
13+
- cron: "30 1 * * 0"
1414
# Sunday at 1:30am UTC
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
CodeQL-Build:
1821
# CodeQL runs on `ubuntu-latest`, `windows-latest`, and `macos-latest`
@@ -38,4 +41,3 @@ jobs:
3841

3942
- name: Perform CodeQL Analysis
4043
uses: github/codeql-action/analyze@v3
41-
...

.github/workflows/cpp.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ on:
1313
schedule:
1414
- cron: "0 14 * * *"
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
build:
18-
1921
runs-on: macos-latest
2022

2123
steps:
@@ -29,4 +31,3 @@ jobs:
2931
-fdiagnostics-print-source-range-info -fdiagnostics-show-option \
3032
-fshow-source-location -ftime-report \
3133
./*.cpp -o HQ9+
32-
...

.github/workflows/flawfinder.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ on:
1313
# The branches below must be a subset of the branches above
1414
branches: ["main"]
1515
schedule:
16-
- cron: '20 23 * * 1'
16+
- cron: "20 23 * * 1"
17+
18+
permissions:
19+
contents: read
1720

1821
jobs:
1922
flawfinder:
@@ -30,11 +33,10 @@ jobs:
3033
- name: flawfinder_scan
3134
uses: david-a-wheeler/[email protected]
3235
with:
33-
arguments: '--sarif ./'
34-
output: 'flawfinder_results.sarif'
36+
arguments: "--sarif ./"
37+
output: "flawfinder_results.sarif"
3538

3639
- name: Upload analysis results to GitHub Security tab
3740
uses: github/codeql-action/upload-sarif@v3
3841
with:
3942
sarif_file: ${{github.workspace}}/flawfinder_results.sarif
40-
...

.github/workflows/jsonlint.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
branches:
77
- main
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
format-json:
1114
name: Format JSON files and create a pull request
@@ -97,4 +100,3 @@ jobs:
97100
labels: enhancement, github_actions
98101
branch: format-json
99102
base: ${{ github.head_ref }}
100-
...

.github/workflows/shellcheck-markdown.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ concurrency:
1010
group: ${{ github.ref }}
1111
cancel-in-progress: true
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
build:
1518
runs-on: ubuntu-latest
@@ -92,4 +95,3 @@ jobs:
9295
./codesnippets_code \
9396
"$0" ||
9497
exit 1
95-
...

.github/workflows/super-linter.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ name: Super-Linter
1717
on:
1818
push:
1919

20+
############################
21+
# Ensure safer permissions #
22+
############################
23+
permissions:
24+
contents: read
25+
2026
###############
2127
# Set the Job #
2228
###############
@@ -49,4 +55,3 @@ jobs:
4955
VALIDATE_ALL_CODEBASE: false
5056
DEFAULT_BRANCH: main
5157
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52-
...

0 commit comments

Comments
 (0)