Skip to content

Commit e2a94c9

Browse files
committed
update workflows to use proper permissions
Signed-off-by: Armin Schrenk <armin.schrenk@skymatic.de>
1 parent 5a1ee28 commit e2a94c9

4 files changed

Lines changed: 14 additions & 1 deletion

File tree

‎.github/workflows/build.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ jobs:
1212
name: Build and Test
1313
runs-on: ubuntu-latest
1414
permissions:
15+
contents: read # Required for checkout
1516
id-token: write # Required for the attestations step
1617
attestations: write # Required for the attestations step
18+
artifact-metadata: write # Required for the attestations step
1719
steps:
1820
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1921
- uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
@@ -41,7 +43,8 @@ jobs:
4143
deploy-central:
4244
name: Deploy to Maven Central
4345
runs-on: ubuntu-latest
44-
permissions: {}
46+
permissions:
47+
contents: read # Required for checkout
4548
needs: [build]
4649
if: github.repository_owner == 'cryptomator' && (startsWith(github.ref, 'refs/tags/') || contains(github.event.head_commit.message, '[deploy]'))
4750
steps:
@@ -76,6 +79,7 @@ jobs:
7679
runs-on: ubuntu-latest
7780
permissions:
7881
packages: write # Required for the deploy to GitHub Packages step
82+
contents: read # Required for checkout
7983
needs: [build]
8084
if: github.repository_owner == 'cryptomator' && (startsWith(github.ref, 'refs/tags/') || contains(github.event.head_commit.message, '[deploy]'))
8185
steps:

‎.github/workflows/codeql-analysis.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ jobs:
1313
analyse:
1414
name: Analyse
1515
runs-on: ubuntu-latest
16+
permissions:
17+
actions: read # Required for CodeQL to read the workflow run
18+
contents: read # Required for checkout
19+
security-events: write # Required for uploading the CodeQL results
1620
# dependeabot has on push events only read-only access, but codeql requires write access
1721
if: ${{ !(github.actor == 'dependabot[bot]' && contains(fromJSON('["push"]'), github.event_name)) }}
1822
steps:

‎.github/workflows/dependency-check.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111

1212
jobs:
1313
check-dependencies:
14+
permissions:
15+
contents: read
1416
uses: skymatic/workflows/.github/workflows/run-dependency-check.yml@8356563bf7b8d1c8d693f75ca487e8f57573cec9 # v3.1.0
1517
with:
1618
runner-os: 'ubuntu-latest'

‎.github/workflows/pullrequest.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ defaults:
1111
run:
1212
shell: bash
1313

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
test:
1619
name: Compile and Test

0 commit comments

Comments
 (0)