Skip to content

Commit

Permalink
fix(reuse): Restrict workflow to read permissions
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux authored and nickvergessen committed Jan 22, 2025
1 parent 6d69b03 commit ba51979
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/dispatch-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ on:
type: number
default: 1

permissions:
contents: read

jobs:
repositories:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/lint-yaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ name: Lint

on: pull_request

permissions:
contents: read

jobs:
yaml-lint:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/reuse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ name: REUSE Compliance Check

on: [pull_request]

permissions:
contents: read

jobs:
reuse-compliance-check:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions workflow-templates/appstore-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
release:
types: [published]

permissions:
contents: write

jobs:
build_and_publish:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions workflow-templates/command-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
issue_comment:
types: [created]

permissions:
contents: read

jobs:
init:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions workflow-templates/command-openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
issue_comment:
types: [created]

permissions:
contents: read

jobs:
init:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions workflow-templates/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ env:
# n.b. server will use head_ref, as we want to test the PR branch.
BRANCH: ${{ github.base_ref || github.ref_name }}


permissions:
contents: read

jobs:
init:
runs-on: ubuntu-latest-low
Expand Down
3 changes: 3 additions & 0 deletions workflow-templates/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
release:
types: [published]

permissions:
contents: read

jobs:
build-and-deploy:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions workflow-templates/npm-audit-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
# At 2:30 on Sundays
- cron: '30 2 * * 0'

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions workflow-templates/pr-feedback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
schedule:
- cron: '30 1 * * *'

permissions:
contents: read
pull-requests: write

jobs:
pr-feedback:
if: ${{ github.repository_owner == 'nextcloud' }}
Expand Down
3 changes: 3 additions & 0 deletions workflow-templates/psalm-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ concurrency:
group: psalm-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
matrix:
runs-on: ubuntu-latest-low
Expand Down
3 changes: 3 additions & 0 deletions workflow-templates/psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ concurrency:
group: psalm-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
static-analysis:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions workflow-templates/reuse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ name: REUSE Compliance Check

on: [pull_request]

permissions:
contents: read

jobs:
reuse-compliance-check:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions workflow-templates/update-nextcloud-ocp-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
schedule:
- cron: '5 2 * * 0'

permissions:
contents: read

jobs:
update-nextcloud-ocp:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions workflow-templates/update-nextcloud-ocp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
schedule:
- cron: "5 2 * * 0"

permissions:
contents: read

jobs:
update-nextcloud-ocp:
runs-on: ubuntu-latest
Expand Down

0 comments on commit ba51979

Please sign in to comment.