Skip to content

Commit

Permalink
Define minimal permissions for new GitHub workflows (#3147)
Browse files Browse the repository at this point in the history
  • Loading branch information
diogoteles08 authored Jun 16, 2023
1 parent 8135cc2 commit 5e8a230
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
schedule:
- cron: "6 0 * * *"

permissions:
contents: read

# A workflow run is made up of one or more jobs that can run sequentially or
# in parallel.
jobs:
Expand All @@ -21,6 +24,8 @@ jobs:

call-workflow-release:
needs: [call-workflow-tarball, call-workflow-ctest]
permissions:
contents: write # In order to allow tag creation
uses: ./.github/workflows/release.yml
with:
file_base: ${{ needs.call-workflow-tarball.outputs.file_base }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/h5py.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
schedule:
- cron: "6 0 * * *"

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/netcdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
- 'COPYING**'
- '**.md'

permissions:
contents: read

# Using concurrency to cancel any in-progress job or run
concurrency:
group: ${{ github.workflow }}-${{ github.sha || github.event.pull_request.number }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ on:
required: true
type: string

# Minimal permissions to be inherited by any job that doesn't declare its own permissions
permissions:
contents: read

# Previous workflows must pass to get here so tag the commit that created the files
jobs:
create-tag:
Expand Down

0 comments on commit 5e8a230

Please sign in to comment.