Skip to content

Commit 16e8612

Browse files
committed
ci: define permissions for enforce-labels workflow
Explicitely stating required permissions is considered best practice. This case was detected by Poutine, see https://github.com/boostsecurityio/poutine/blob/main/docs/content/en/rules/default_permissions_on_risky_events.md. Signed-off-by: Florian Greinacher <[email protected]>
1 parent db2bfc9 commit 16e8612

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: .github/workflows/enforce-labels.yml

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ name: "Enforce PR labels"
44
on: # yamllint disable-line rule:truthy
55
pull_request_target:
66
types: [labeled, unlabeled, opened, edited, synchronize]
7+
8+
permissions:
9+
contents: read # to read configuration file
10+
pull-requests: write # to label PRs
11+
712
jobs:
813
enforce-label:
914
if: github.repository == 'dev-sec/ansible-collection-hardening'

0 commit comments

Comments
 (0)