Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
- stable
- v*

permissions: read-all

concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
- stable
- v*

permissions:
contents: read

env:
# For cmake:
VERBOSE: 1
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
- stable
- "v*"

permissions:
contents: read

env:
FORCE_COLOR: 3
# For cmake:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ on:
pull_request_target:
types: [closed]

permissions: {}

jobs:
label:
name: Labeler
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the only line that's needed now that we've changed the default to read only?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is also considered a good practice to keep the minimal permission set on the workflow:

  1. It provides transparency in the permissions used since the settings are not public
  2. It works as a double prevention by preventing from insider risks (since users with admin access can revert the default permissions)

I personally would recommend to keep the minimal permission set on the workflow files either, but if you rather remove them I'd say that the only ones that should stay would be labeler.yml and ci.yml.

PS: ci.yml does not work only with contents and package read.

steps:

- uses: actions/labeler@main
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
types:
- published

permissions:
contents: read

env:
PIP_ONLY_BINARY: numpy

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
workflow_dispatch:
pull_request:

permissions:
contents: read

concurrency:
group: upstream-${{ github.ref }}
cancel-in-progress: true
Expand Down