Skip to content

Commit

Permalink
build: harden ci.yml permissions
Browse files Browse the repository at this point in the history
Signed-off-by: Alex <[email protected]>
  • Loading branch information
sashashura authored and cushon committed Sep 19, 2023
1 parent c9726da commit d5cd47e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@ on:
branches:
- master

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
test:
permissions:
actions: write # to cancel/stop running workflows (styfle/cancel-workflow-action)
contents: read # to fetch code (actions/checkout)

name: "JDK ${{ matrix.java }} on ${{ matrix.os }}"
strategy:
fail-fast: false
Expand Down Expand Up @@ -93,6 +100,9 @@ jobs:
run: mvn source:jar deploy -B -DskipTests=true -Dinvoker.skip=true

generate_docs:
permissions:
contents: write # for git push

name: 'Generate latest docs'
needs: test
if: github.event_name == 'push' && github.repository == 'google/error-prone' && github.ref == 'refs/heads/master'
Expand Down

0 comments on commit d5cd47e

Please sign in to comment.