Skip to content

Commit

Permalink
ci: Restrict content permissions to harden GitHub Actions (#2484)
Browse files Browse the repository at this point in the history
* Restrict content permissions to read. At the moment there are no
  steps to the changed workflows that use tokens, and so this is
  preventative if this ever changes.
* Give packages write permissions to publish to ghcr.
   - Amends PR #2483.
  • Loading branch information
matthewfeickert committed May 25, 2024
1 parent cdd404a commit 42cd129
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ permissions:
jobs:
docker:
name: Build, test, and publish Docker images to Docker Hub
permissions:
contents: read
packages: write # for docker to push to registry
runs-on: ubuntu-latest

steps:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
name: Build docs
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
lint:

Expand Down

0 comments on commit 42cd129

Please sign in to comment.