Skip to content

Commit

Permalink
ci: set minimal permissions to github workflows (#4665)
Browse files Browse the repository at this point in the history
* set ci.yml minimal permissions

Signed-off-by: Joyce <joycebrum@google.com>

* set configure.yml minimal permissions

Signed-off-by: Joyce <joycebrum@google.com>

* set format.yml minimal permissions

Signed-off-by: Joyce <joycebrum@google.com>

* set pip.yml minimal permissions

Signed-off-by: Joyce <joycebrum@google.com>

* set upstream.yml minimal permissions

Signed-off-by: Joyce <joycebrum@google.com>

* set labeler.yml minimal permissions

Signed-off-by: Joyce <joycebrum@google.com>

* Update ci.yml to read all

Signed-off-by: Joyce <joycebrum@google.com>

* test labeler.yml

Signed-off-by: Joyce <joycebrum@google.com>

* restore the if at labeler.yml

Signed-off-by: Joyce <joycebrum@google.com>

---------

Signed-off-by: Joyce <joycebrum@google.com>
  • Loading branch information
joycebrum authored May 15, 2023
1 parent cca4c51 commit d72ffb4
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 0 deletions.
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
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

0 comments on commit d72ffb4

Please sign in to comment.