Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define minimal permissions for new GitHub workflows #3147

Merged
merged 2 commits into from
Jun 16, 2023
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
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