Skip to content

Commit

Permalink
Merge branch 'lukas/gh/maint-26' into maint-26
Browse files Browse the repository at this point in the history
* lukas/gh/maint-26:
  gh: Limit scope of GITHUB_TOKEN and only use permissions where needed
  github: add OSV automated vulnerability checking
  • Loading branch information
garazdawi committed Nov 13, 2024
2 parents 57f154f + 58b45f2 commit 1e0c517
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/actions-updater.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
# Automatically run on every Sunday
- cron: '0 0 * * 0'

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ env:
## Equivalent to github.event_name == 'pull_request' ? github.base_ref : github.ref_name
BASE_BRANCH: ${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }}

permissions:
contents: read

jobs:

pack:
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/osv-scanner-scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ on:
- cron: 0 1 * * *

permissions:
# Required to upload SARIF file to CodeQL.
# See: https://github.com/github/codeql-action/issues/2117
actions: read
# Require writing security events to upload SARIF file to security tab
security-events: write
# Only need to read contents
contents: read

jobs:
Expand Down Expand Up @@ -72,4 +66,12 @@ jobs:
# run-scheduled-scan triggers this job
# PRs and pushes trigger this job
if: github.event_name != 'schedule'
permissions:
# Required to upload SARIF file to CodeQL.
# See: https://github.com/github/codeql-action/issues/2117
actions: read
# Require writing security events to upload SARIF file to security tab
security-events: write
# Only needs to read contents
contents: read
uses: "google/osv-scanner-action/.github/workflows/[email protected]"
3 changes: 3 additions & 0 deletions .github/workflows/pr-comment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
# Limit concurrency so that we don't get any races between parallel actions
concurrency: pr-comment

permissions:
contents: read

jobs:
pr-number:
runs-on: ubuntu-20.04
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/sync-github-prs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
## In UTC
- cron: '0 */4 * * *'

permissions:
contents: read

jobs:

sync-prs:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/sync-github-releases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

## Needed to create releases
permissions:
contents: write
contents: read

## Build base images to be used by other github workflows
jobs:
Expand All @@ -18,6 +18,9 @@ jobs:
if: github.repository == 'erlang/otp'
concurrency: sync-github-releases
runs-on: ubuntu-latest
permissions:
## Needed to create releases
contents: write
steps:
- uses: actions/[email protected]
## We need to login to the package registry in order to pull
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/update-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
## In UTC
- cron: '0 0 * * *'

permissions:
contents: read

## Build base images to be used by other github workflows
jobs:

Expand Down

0 comments on commit 1e0c517

Please sign in to comment.