Skip to content

Commit 491e69f

Browse files
ashishkurmijuchaosong
authored andcommitted
ci: add minimum GitHub token permissions for workflows (argoproj#9552)
Signed-off-by: juchao <[email protected]>
1 parent 2130de3 commit 491e69f

File tree

6 files changed

+28
-0
lines changed

6 files changed

+28
-0
lines changed

.github/workflows/changelog.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ on:
55
tags:
66
- v*
77
- "!v0.0.0"
8+
permissions:
9+
contents: read
10+
811
jobs:
912
generate_changelog:
13+
permissions:
14+
contents: write # for peter-evans/create-pull-request to create branch
15+
pull-requests: write # for peter-evans/create-pull-request to create a PR
1016
if: github.repository == 'argoproj/argo-workflows'
1117
runs-on: ubuntu-latest
1218
name: Generate changelog

.github/workflows/ci-build.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ concurrency:
1313
group: ${{ github.workflow }}-${{ github.ref }}
1414
cancel-in-progress: true
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
tests:
1821
name: Unit Tests

.github/workflows/gh-pages.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ concurrency:
1212
group: ${{ github.workflow }}-${{ github.ref }}
1313
cancel-in-progress: true
1414

15+
permissions:
16+
contents: read
17+
1518
jobs:
1619
docs:
1720
runs-on: ubuntu-latest

.github/workflows/release.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ defaults:
1616
run:
1717
shell: bash
1818

19+
permissions:
20+
contents: read
21+
1922
jobs:
2023
build-linux-amd64:
2124
name: Build & push linux/amd64
@@ -317,6 +320,8 @@ jobs:
317320
done
318321
319322
publish-release:
323+
permissions:
324+
contents: write # for softprops/action-gh-release to create GitHub release
320325
runs-on: ubuntu-latest
321326
if: github.repository == 'argoproj/argo-workflows'
322327
needs: [ push-images, test-images-linux-amd64, test-images-windows ]

.github/workflows/sdks.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@ on:
33
push:
44
tags:
55
- v*
6+
7+
permissions:
8+
contents: read
9+
610
jobs:
711
sdk:
12+
permissions:
13+
contents: read
14+
packages: write # for publishing packages
15+
contents: write # for creating releases
816
if: github.repository == 'argoproj/argo-workflows'
917
runs-on: ubuntu-latest
1018
name: Publish SDK

.github/workflows/snyk.yml

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Snyk
22
on:
33
schedule:
44
- cron: "30 2 * * *"
5+
permissions:
6+
contents: read
7+
58
jobs:
69
# we do not scan images here, they're scanned here: https://app.snyk.io/org/argoproj/projects
710

0 commit comments

Comments
 (0)