Skip to content

Commit f82a7a8

Browse files
committed
Set specific token permissions in GH actions
1 parent ab09e78 commit f82a7a8

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.github/workflows/dependabot-code-gen.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,20 @@ on:
99
- dependabot/**
1010
workflow_dispatch:
1111

12-
permissions:
13-
contents: write # Allow to update the PR.
12+
permissions: # added using https://github.com/step-security/secure-repo
13+
contents: read
1414

1515
jobs:
1616
build:
17+
permissions:
18+
contents: write # for EndBug/add-and-commit
1719
name: Build
1820
runs-on: ubuntu-latest
1921
steps:
2022
- name: Harden Runner
2123
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
2224
with:
2325
egress-policy: audit
24-
2526
- name: Set up Go 1.x
2627
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
2728
with:

.github/workflows/release.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@ on:
44
tags:
55
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
66

7+
permissions: # added using https://github.com/step-security/secure-repo
8+
contents: read
9+
710
name: release
811

912
jobs:
1013
build:
14+
permissions:
15+
contents: write # for softprops/action-gh-release to create GitHub release
1116
name: tag release
1217
runs-on: ubuntu-latest
1318
steps:

0 commit comments

Comments
 (0)