Skip to content

Commit 683a141

Browse files
authored
[chore] add default permissions block to workflows (#959)
This addresses a few of the dependabot warnings for the repo. Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
1 parent c1ae2f6 commit 683a141

25 files changed

+104
-2
lines changed

.github/workflows/base-ci-goreleaser.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Reusable GoReleaser CI workflow
22

3+
permissions:
4+
contents: read
5+
36
on:
47
workflow_call:
58
inputs:
@@ -64,6 +67,7 @@ jobs:
6467
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6568
with:
6669
fetch-depth: 0
70+
persist-credentials: false
6771

6872
- name: Setup QEMU
6973
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
@@ -264,6 +268,8 @@ jobs:
264268
steps:
265269
- name: Checkout
266270
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
271+
with:
272+
persist-credentials: false
267273

268274
- name: Setup QEMU
269275
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0

.github/workflows/base-package-tests.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Package Tests
22

3+
permissions:
4+
contents: read
5+
36
on:
47
workflow_call:
58
inputs:
@@ -25,6 +28,8 @@ jobs:
2528
steps:
2629
- name: Checkout
2730
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
31+
with:
32+
persist-credentials: false
2833

2934
- name: Download built artifacts
3035
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0

.github/workflows/base-release.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Reusable release workflow
22

3+
permissions:
4+
contents: read
5+
36
on:
47
workflow_call:
58
inputs:
@@ -42,6 +45,7 @@ jobs:
4245
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4346
with:
4447
fetch-depth: 0
48+
persist-credentials: false
4549

4650
- uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v3.8.2
4751

@@ -154,6 +158,7 @@ jobs:
154158
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
155159
with:
156160
fetch-depth: 0
161+
persist-credentials: false
157162

158163
- uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v3.8.2
159164

.github/workflows/builder-release.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
name: Release Builder
2+
3+
permissions:
4+
contents: read
5+
26
on:
37
push:
48
tags:
@@ -22,6 +26,7 @@ jobs:
2226
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2327
with:
2428
fetch-depth: 0
29+
persist-credentials: false
2530
- name: Push cmd/builder Tag
2631
run: |
2732
tag="cmd/builder/${{ github.ref_name }}"
@@ -37,6 +42,7 @@ jobs:
3742
repository: "open-telemetry/opentelemetry-collector"
3843
ref: ${{ github.ref_name }}
3944
path: ".core"
45+
persist-credentials: false
4046
- name: Copy Dockerfile to Core Repo directory
4147
run: cp cmd/builder/Dockerfile .core/cmd/builder/Dockerfile
4248
- uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v3.8.2

.github/workflows/builder-testbuild.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: CI - Builder
22

3+
permissions:
4+
contents: read
5+
36
on:
47
merge_group:
58
push:
@@ -35,12 +38,14 @@ jobs:
3538
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3639
with:
3740
fetch-depth: 0
41+
persist-credentials: false
3842
- name: Checkout Core Repo
3943
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4044
with:
4145
fetch-depth: 0
4246
repository: "open-telemetry/opentelemetry-collector"
4347
path: ".core"
48+
persist-credentials: false
4449
- name: Copy Dockerfile to Core Repo directory
4550
run: cp cmd/builder/Dockerfile .core/cmd/builder/Dockerfile
4651
- uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v3.8.2

.github/workflows/changelog.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
name: Changelog
77

8+
permissions:
9+
contents: read
10+
811
on:
912
pull_request:
1013
types: [opened, synchronize, reopened, labeled, unlabeled]
@@ -28,10 +31,11 @@ jobs:
2831
PR_HEAD: ${{ github.event.pull_request.head.sha }}
2932

3033
steps:
31-
- uses: actions/checkout@v4
34+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3235
with:
3336
fetch-depth: 0
34-
- uses: actions/setup-go@v5
37+
persist-credentials: false
38+
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
3539
with:
3640
go-version: "~1.24"
3741
cache: false

.github/workflows/ci-goreleaser-contrib.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: CI - Contrib - GoReleaser
22

3+
permissions:
4+
contents: read
5+
36
on:
47
merge_group:
58
push:

.github/workflows/ci-goreleaser-core.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: CI - Core - GoReleaser
22

3+
permissions:
4+
contents: read
5+
36
on:
47
merge_group:
58
push:

.github/workflows/ci-goreleaser-ebpf-profiler.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: CI - eBPF Profiler - GoReleaser
22

3+
permissions:
4+
contents: read
5+
36
on:
47
merge_group:
58
push:

.github/workflows/ci-goreleaser-k8s.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: CI - k8s - GoReleaser
22

3+
permissions:
4+
contents: read
5+
36
on:
47
merge_group:
58
push:

0 commit comments

Comments
 (0)