mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-13 11:34:54 +00:00
Add an explicit top-level permissions block to the GitHub Actions workflows that were relying on the default token permissions. Each workflow now defaults to contents: read, with additional scopes granted only where a job needs them: * nightly-trivy-scan keeps security-events: write at the job level to upload SARIF results, plus contents: read for checkout. * stale-issues gets issues: write and pull-requests: write for the actions/stale action to label and close stale items. Setting least-privilege permissions reduces the blast radius if a workflow or one of its dependencies is compromised, and satisfies the CLOMonitor token_permissions check. Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
37 lines
818 B
YAML
37 lines
818 B
YAML
name: Pull Request Linter Check
|
|
on:
|
|
pull_request:
|
|
# Do not run when the change only includes these directories.
|
|
paths-ignore:
|
|
- "site/**"
|
|
- "design/**"
|
|
- "**/*.md"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
get-go-version:
|
|
uses: ./.github/workflows/get-go-version.yaml
|
|
with:
|
|
ref: ${{ github.event.pull_request.base.ref }}
|
|
|
|
build:
|
|
name: Run Linter Check
|
|
runs-on: ubuntu-latest
|
|
needs: get-go-version
|
|
steps:
|
|
- name: Check out the code
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Set up Go version
|
|
uses: actions/setup-go@v7
|
|
with:
|
|
go-version: ${{ needs.get-go-version.outputs.version }}
|
|
|
|
- name: Linter check
|
|
uses: golangci/golangci-lint-action@v9
|
|
with:
|
|
version: v2.12.0
|
|
args: --verbose
|