mirror of
https://github.com/submariner-io/submariner-charts.git
synced 2026-09-20 21:30:35 +00:00
Minimize GHA permissions
Set the GitHub Actions token permission to null in most workflows. This results in: GITHUB_TOKEN Permissions Metadata: read The default permissions, used without the null override, are either GITHUB_TOKEN Permissions Actions: write Checks: write Contents: write Deployments: write Discussions: write Issues: write Metadata: read Packages: write Pages: write PullRequests: write RepositoryProjects: write SecurityEvents: write Statuses: write or GITHUB_TOKEN Permissions Actions: read Checks: read Contents: read Deployments: read Discussions: read Issues: read Metadata: read Packages: read Pages: read PullRequests: read RepositoryProjects: read SecurityEvents: read Statuses: read Jobs triggered by PRs get read permissions, other jobs get write. One job requires non-null permissions to function. The dependent issues GHA needs PR/issues write permissions to add/remove `dependent` labels. It needs status write permission to block/unblock PRs when dependencies are missing/met. Fails with HttpError otherwise. Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
This commit is contained in:
committed by
Stephen Kitt
parent
01599cbb65
commit
e16a2c36df
@@ -4,6 +4,8 @@ name: Branch Checks
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
target_branch:
|
||||
name: PR targets branch
|
||||
|
||||
@@ -19,6 +19,11 @@ on:
|
||||
schedule:
|
||||
- cron: '0 0/6 * * *' # every 6 hours
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
statuses: write
|
||||
|
||||
jobs:
|
||||
check:
|
||||
name: Check Dependencies
|
||||
|
||||
@@ -5,6 +5,8 @@ on:
|
||||
pull_request:
|
||||
types: [labeled, opened, synchronize, reopened]
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
e2e:
|
||||
name: E2E
|
||||
|
||||
@@ -4,6 +4,8 @@ name: End to End Default
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
e2e:
|
||||
name: E2E
|
||||
|
||||
@@ -5,6 +5,8 @@ on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
e2e:
|
||||
name: E2E
|
||||
|
||||
@@ -4,6 +4,8 @@ name: Linting
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
apply-suggestions-commits:
|
||||
name: 'No "Apply suggestions from code review" Commits'
|
||||
|
||||
@@ -5,6 +5,8 @@ on:
|
||||
schedule:
|
||||
- cron: "0 0 * * 0"
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
markdown-link-check-periodic:
|
||||
name: Markdown Links (all files)
|
||||
|
||||
@@ -6,6 +6,8 @@ on:
|
||||
branches:
|
||||
- devel
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
|
||||
Reference in New Issue
Block a user