Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Declare what each workflow may do with the token and stop persisting checkout credentials (#6784)

Thibaud-Vdb3644844d8105
diff --git a/.github/workflows/build-public-images-ghcr.yml b/.github/workflows/build-public-images-ghcr.yml
index 5f6af9643e..12d62b5e3a 100644
--- a/.github/workflows/build-public-images-ghcr.yml
+++ b/.github/workflows/build-public-images-ghcr.yml
@@ -4,6 +4,10 @@ on:
push:
tags: ["v*"]
+permissions:
+ contents: read
+ packages: write
+
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml
index 2310126223..bc8ac15094 100644
--- a/.github/workflows/elixir.yml
+++ b/.github/workflows/elixir.yml
@@ -6,6 +6,9 @@ on:
branches: [master, stable]
merge_group:
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
@@ -18,6 +21,9 @@ env:
jobs:
build:
+ permissions:
+ contents: read
+ pull-requests: read
name: "Build and test (${{ matrix.mix_env }}, ${{ matrix.postgres_image }}, ${{ matrix.mix_test_partition }})"
runs-on: blacksmith-4vcpu-ubuntu-2404
strategy:
@@ -44,6 +50,7 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
+ persist-credentials: false
fetch-depth: 0
filter: blob:none
@@ -111,6 +118,9 @@ jobs:
MIX_TEST_PARTITION: ${{ matrix.mix_test_partition }}
e2e:
+ permissions:
+ contents: read
+ pull-requests: read
name: End-to-end tests
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 15
@@ -138,6 +148,7 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
+ persist-credentials: false
fetch-depth: 0
filter: blob:none
@@ -238,6 +249,8 @@ jobs:
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24.22.1
@@ -265,6 +278,7 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
+ persist-credentials: false
fetch-depth: 0
filter: blob:none
diff --git a/.github/workflows/iana-registry-check.yml b/.github/workflows/iana-registry-check.yml
index e3fc1683cd..aae535e660 100644
--- a/.github/workflows/iana-registry-check.yml
+++ b/.github/workflows/iana-registry-check.yml
@@ -15,6 +15,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
- uses: marocchino/tool-versions-action@4219f2e6bfdb4cce482b78f71ad9663e64f4d247 # v2.0.0
id: versions
diff --git a/.github/workflows/migrations-validation.yml b/.github/workflows/migrations-validation.yml
index 1e9a80c788..6336e96eca 100644
--- a/.github/workflows/migrations-validation.yml
+++ b/.github/workflows/migrations-validation.yml
@@ -6,6 +6,10 @@ on:
- 'priv/repo/migrations/**'
- 'priv/ingest_repo/migrations/**'
+permissions:
+ contents: read
+ pull-requests: read
+
jobs:
validate:
name: App code does not change at the same time
diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml
index cc543917d3..ca363dd337 100644
--- a/.github/workflows/node.yml
+++ b/.github/workflows/node.yml
@@ -6,6 +6,9 @@ on:
pull_request:
merge_group:
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
@@ -21,6 +24,8 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
- name: Read .tool-versions
uses: marocchino/tool-versions-action@4219f2e6bfdb4cce482b78f71ad9663e64f4d247 # v2.0.0
id: versions
diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml
index 88f3f77a83..42c259c6dc 100644
--- a/.github/workflows/publish-docs.yml
+++ b/.github/workflows/publish-docs.yml
@@ -23,6 +23,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
- name: Read .tool-versions
uses: marocchino/tool-versions-action@4219f2e6bfdb4cce482b78f71ad9663e64f4d247 # v2.0.0
diff --git a/.github/workflows/terraform-e2e.yml b/.github/workflows/terraform-e2e.yml
index d1e2a574bf..7943c00d2c 100644
--- a/.github/workflows/terraform-e2e.yml
+++ b/.github/workflows/terraform-e2e.yml
@@ -10,12 +10,18 @@ on:
paths:
- 'test/e2e/**.tf'
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
terraform:
+ permissions:
+ contents: read
+ pull-requests: write
concurrency: terraform_checkly
defaults:
run:
@@ -28,6 +34,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
- name: Setup Terraform
uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4.0.1
diff --git a/.github/workflows/tracker-script-update.yml b/.github/workflows/tracker-script-update.yml
index aab30667ed..4e5aeb8f01 100644
--- a/.github/workflows/tracker-script-update.yml
+++ b/.github/workflows/tracker-script-update.yml
@@ -25,6 +25,7 @@ jobs:
- name: Checkout master for comparison
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
+ persist-credentials: false
ref: master
path: master-branch
diff --git a/.github/workflows/tracker.yml b/.github/workflows/tracker.yml
index a8c9fc29e4..0cd67961fc 100644
--- a/.github/workflows/tracker.yml
+++ b/.github/workflows/tracker.yml
@@ -6,6 +6,9 @@ on:
paths:
- "tracker/**"
+permissions:
+ contents: read
+
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
@@ -25,6 +28,8 @@ jobs:
shardTotal: [4]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24.22.1
@@ -48,6 +53,8 @@ jobs:
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24.22.1
diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml
index 0f412829ae..942f2be082 100644
--- a/.github/workflows/typos.yml
+++ b/.github/workflows/typos.yml
@@ -6,9 +6,14 @@ on:
branches: [ master ]
merge_group:
+permissions:
+ contents: read
+
jobs:
typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
- uses: crate-ci/typos@7f9d0819ca1c008ade73f4b41fa9d258d48f605b # v1.51.1