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 <[email protected]>
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:

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

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

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

.github/workflows/ci.yaml

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

3+
permissions:
4+
contents: read
5+
36
on:
47
merge_group:
58
push:
@@ -16,6 +19,7 @@ jobs:
1619
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1720
with:
1821
fetch-depth: 0
22+
persist-credentials: false
1923

2024
- name: Setup Go
2125
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0

.github/workflows/fossa.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
with:
17+
persist-credentials: false
1618

1719
- uses: fossas/fossa-action@3ebcea1862c6ffbd5cf1b4d0bd6b3fe7bd6f2cac # v1.7.0
1820
with:

.github/workflows/msi-tests.yaml

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

3+
permissions:
4+
contents: read
5+
36
on:
47
workflow_call:
58
inputs:
@@ -20,6 +23,8 @@ jobs:
2023
steps:
2124
- name: Checkout
2225
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
with:
27+
persist-credentials: false
2328

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

.github/workflows/opampsupervisor-release.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
name: Release OpAMP supervisor
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/opampsupervisor Tag
2631
run: |
2732
tag="cmd/opampsupervisor/${{ github.ref_name }}"
@@ -37,6 +42,7 @@ jobs:
3742
repository: "open-telemetry/opentelemetry-collector-contrib"
3843
ref: ${{ github.ref_name }}
3944
path: ".contrib"
45+
persist-credentials: false
4046
- name: Copy Dockerfile to Contrib Repo directory
4147
run: cp cmd/opampsupervisor/Dockerfile .contrib/cmd/opampsupervisor/Dockerfile
4248
- uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v3.8.2

.github/workflows/opampsupervisor-testbuild.yaml

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

3+
permissions:
4+
contents: read
5+
36
on:
47
merge_group:
58
push:
@@ -33,12 +36,14 @@ jobs:
3336
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3437
with:
3538
fetch-depth: 0
39+
persist-credentials: false
3640
- name: Checkout Core Repo
3741
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3842
with:
3943
fetch-depth: 0
4044
repository: "open-telemetry/opentelemetry-collector-contrib"
4145
path: ".contrib"
46+
persist-credentials: false
4247
- name: Copy Dockerfile to Core Repo directory
4348
run: cp cmd/opampsupervisor/Dockerfile .contrib/cmd/opampsupervisor/Dockerfile
4449
- uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v3.8.2

.github/workflows/package-test.yaml

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

3+
permissions:
4+
contents: read
5+
36
on:
47
schedule:
58
- cron: "0 2 * * *" # every day at 2am UTC

.github/workflows/release-contrib.yaml

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

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
58
tags: ["v*"]

.github/workflows/release-core.yaml

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

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
58
tags: ["v*"]

.github/workflows/release-ebpf-profiler.yaml

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

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
58
tags: ["v*"]

.github/workflows/release-k8s.yaml

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

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
58
tags: ["v*"]

.github/workflows/release-otlp.yaml

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

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
58
tags: ["v*"]

.github/workflows/shellcheck.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
name: Shellcheck lint
2+
3+
permissions:
4+
contents: read
5+
26
on:
37
merge_group:
48
push:
@@ -12,6 +16,8 @@ jobs:
1216
runs-on: ubuntu-latest
1317
steps:
1418
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19+
with:
20+
persist-credentials: false
1521
- name: Run ShellCheck
1622
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # 2.0.0
1723
env:

.github/workflows/stale.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
name: "Close stale issues and pull requests"
2+
3+
permissions:
4+
contents: read
5+
26
on:
37
workflow_dispatch:
48
schedule:

.github/workflows/update-version.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
name: Update Version in Distributions and Prepare PR
2+
3+
permissions:
4+
contents: read
5+
26
on:
37
workflow_dispatch:
48
inputs:
@@ -23,6 +27,8 @@ jobs:
2327
steps:
2428
- name: Checkout repository
2529
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30+
with:
31+
persist-credentials: false
2632

2733
- name: Run bump-versions.sh
2834
run: |

0 commit comments

Comments
 (0)