Skip to content

Commit 07e0e52

Browse files
neilnaveenmislav
andauthored
Fixed permission for workflow (cli#5279)
https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions Co-authored-by: Mislav Marohnić <mislav@github.com>
1 parent ca98aec commit 07e0e52

File tree

6 files changed

+31
-4
lines changed

6 files changed

+31
-4
lines changed

.github/workflows/codeql.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ on:
1010
schedule:
1111
- cron: "0 0 * * 0"
1212

13+
permissions:
14+
actions: read # for github/codeql-action/init to get workflow details
15+
contents: read # for actions/checkout to fetch code
16+
security-events: write # for github/codeql-action/analyze to upload SARIF results
17+
1318
jobs:
1419
CodeQL-Build:
1520
runs-on: ubuntu-latest

.github/workflows/go.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Tests
22
on: [push, pull_request]
3+
4+
permissions:
5+
contents: read
6+
37
jobs:
48
build:
59
strategy:

.github/workflows/issueauto.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,21 @@ name: Issue Automation
22
on:
33
issues:
44
types: [opened]
5+
6+
permissions:
7+
contents: none
8+
issues: write
9+
510
jobs:
611
issue-auto:
712
runs-on: ubuntu-latest
813
steps:
914
- name: label incoming issue
1015
env:
11-
GH_REPO: ${{ github.repository }}
12-
GH_TOKEN: ${{ secrets.AUTOMATION_TOKEN }}
13-
ISSUENUM: ${{ github.event.issue.number }}
14-
ISSUEAUTHOR: ${{ github.event.issue.user.login }}
16+
GH_REPO: ${{ github.repository }}
17+
GH_TOKEN: ${{ secrets.AUTOMATION_TOKEN }}
18+
ISSUENUM: ${{ github.event.issue.number }}
19+
ISSUEAUTHOR: ${{ github.event.issue.user.login }}
1520
run: |
1621
if ! gh api orgs/cli/public_members/$ISSUEAUTHOR --silent 2>/dev/null
1722
then

.github/workflows/lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
- go.mod
1212
- go.sum
1313

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
lint:
1619
runs-on: ubuntu-latest

.github/workflows/prauto.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ name: PR Automation
22
on:
33
pull_request_target:
44
types: [ready_for_review, opened, reopened]
5+
6+
permissions:
7+
contents: none
8+
issues: write
9+
pull-requests: write
10+
511
jobs:
612
pr-auto:
713
runs-on: ubuntu-latest

.github/workflows/releases.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
tags:
66
- "v*"
77

8+
permissions:
9+
contents: write # publishing releases
10+
repository-projects: write # move cards between columns
11+
812
jobs:
913
goreleaser:
1014
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)