Skip to content

Commit

Permalink
Explicit permissions for github actions
Browse files Browse the repository at this point in the history
To improve OSSF Scorecard score on Scorecard repo
  • Loading branch information
Guillaume Ross authored and naveensrinivasan committed Mar 29, 2022
1 parent 007156b commit 682e6ea
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ on:

permissions:
contents: read
statuses: write
security-events: write

jobs:
analyze:
permissions:
actions: read # for github/codeql-action/init to get workflow details
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/autobuild to send a status report
name: Analyze
runs-on: ubuntu-latest

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

permissions:
contents: read

name: docker-build
on:
push:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ on:
tags:
- "*" # triggers only if push new tag version, like `0.8.4` or else

permissions:
contents: read

jobs:
goreleaser:
runs-on: ubuntu-latest
permissions:
contents: write
contents: write # for goreleaser/goreleaser-action to create a GitHub release
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
# limitations under the License.

name: build

permissions:
contents: read

on:
push:
branches:
Expand Down

0 comments on commit 682e6ea

Please sign in to comment.