Skip to content

Commit

Permalink
[Security] Token permissions no. 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludy87 committed Dec 21, 2024
1 parent b86eac2 commit f29d4db
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 27 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/PR-Demo-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ on:
pull_request:
types: [opened, synchronize, reopened, closed]

permissions:
contents: write
pull-requests: write
permissions: read-all

env:
SERVER_IP: ${{ secrets.VPS_IP }} # Add this to your GitHub secrets
Expand All @@ -15,6 +13,9 @@ env:
jobs:
cleanup:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
if: github.event.action == 'closed'

steps:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/auto-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ on:
pull_request_target:
types: [opened, synchronize]

permissions:
contents: read
pull-requests: write
permissions: read-all

jobs:
labeler:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/licenses-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ on:
paths:
- "build.gradle"

permissions:
contents: write
pull-requests: write
permissions: read-all

jobs:
generate-license-report:
runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/manage-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ on:
schedule:
- cron: "30 20 * * *"

permissions:
contents: read
issues: write
permissions: read-all

jobs:
labeler:
name: Labeler
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/multiOSReleases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ on:
workflow_dispatch:
release:
types: [created]
permissions:
contents: write
packages: write

permissions: read-all

jobs:
build-installers:
strategy:
Expand All @@ -22,6 +22,9 @@ jobs:
# platform: linux
# ext: deb
runs-on: ${{ matrix.os }}
permissions:
contents: write
packages: write

steps:
- name: Harden Runner
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/push-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ on:
- master
- main

permissions:
contents: read
packages: write
permissions: read-all

jobs:
push:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/releaseArtifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ on:
workflow_dispatch:
release:
types: [created]
permissions:
contents: write
packages: write

permissions: read-all

jobs:
push:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
strategy:
matrix:
enable_security: [true, false]
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ on:
- cron: "30 0 * * *"
workflow_dispatch:

permissions:
contents: read
permissions: read-all

jobs:
stale:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
branches:
- master

permissions: read-all

jobs:
push:
runs-on: ubuntu-latest
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/sync_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ on:
- "src/main/resources/messages_*.properties"
- "scripts/ignore_translation.toml"

permissions:
contents: write
pull-requests: write
permissions: read-all

jobs:
sync-readme:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
Expand Down

0 comments on commit f29d4db

Please sign in to comment.