Skip to content

Commit e27fd0a

Browse files
Add Workflow Permissions (#1432)
* Add default permissions to all workflows in GHA * Remove megalinter status permissions --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent b089b33 commit e27fd0a

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

.github/workflows/addlicense.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ on:
2222
- "**"
2323
pull_request:
2424

25+
permissions:
26+
contents: read
27+
2528
concurrency:
2629
group: ${{ github.ref || github.run_id }}-${{ github.workflow }}
2730
cancel-in-progress: true

.github/workflows/build-ci-image.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ name: Build CI Image
1717
on:
1818
workflow_dispatch: # Allow manual trigger
1919

20+
permissions:
21+
contents: read
22+
2023
concurrency:
2124
group: ${{ github.ref || github.run_id }}
2225
cancel-in-progress: true
@@ -25,6 +28,10 @@ jobs:
2528
build:
2629
runs-on: ubuntu-24.04
2730

31+
permissions:
32+
contents: read
33+
packages: write
34+
2835
steps:
2936
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
3037
with:

.github/workflows/mega-linter.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ on:
2222
# push: # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions)
2323
pull_request:
2424

25+
permissions:
26+
contents: read
27+
2528
env: # Comment env block if you don't want to apply fixes
2629
# Apply linter fixes configuration
2730
APPLY_FIXES: all # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool)
@@ -42,7 +45,6 @@ jobs:
4245
contents: write
4346
issues: write
4447
pull-requests: write
45-
statuses: write
4648
steps:
4749
# Git Checkout
4850
- name: Checkout Code
@@ -62,7 +64,6 @@ jobs:
6264
VALIDATE_ALL_CODEBASE: "true"
6365
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6466
# ADD YOUR CUSTOM ENV VARIABLES HERE OR DEFINE THEM IN A FILE .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY
65-
GITHUB_STATUS_REPORTER: "true"
6667
GITHUB_COMMENT_REPORTER: "true"
6768
PYTHON_RUFF_ARGUMENTS: --config pyproject.toml --config 'output-format="github"'
6869
PYTHON_RUFF_FORMAT_ARGUMENTS: --config pyproject.toml --config 'output-format="github"'

.github/workflows/trivy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ concurrency:
2121
group: ${{ github.ref || github.run_id }}-${{ github.workflow }}
2222
cancel-in-progress: true
2323

24+
permissions:
25+
contents: read
26+
2427
jobs:
2528
# Upload Trivy data
2629
trivy:

0 commit comments

Comments
 (0)