Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

ci(build-publish): least-privilege token + pin third-party action

Jose Ramirez70ecddf9efca
diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml
index 2fdd53d46..bfe9aa73e 100644
--- a/.github/workflows/build-publish.yml
+++ b/.github/workflows/build-publish.yml
@@ -29,9 +29,11 @@ on:
type: boolean
default: false
+# Least-privilege default: only build-push needs to write packages. detect (runs
+# the third-party paths-filter action) and notify-infra get read-only, so a
+# compromised action in those jobs cannot push images to ghcr.
permissions:
contents: read
- packages: write
env:
REGISTRY: ghcr.io
@@ -93,7 +95,9 @@ jobs:
- name: Detect changed paths
id: filter
if: steps.base.outputs.force_all != 'true'
- uses: dorny/paths-filter@v4
+ # SHA-pinned (v4): third-party, individual-maintainer action — pin so a
+ # hijacked tag can't run arbitrary code in a job that has repo write.
+ uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4
with:
base: ${{ github.event.before }}
filters: |
@@ -158,6 +162,9 @@ jobs:
name: Build & push (${{ matrix.image }})
runs-on: ubuntu-latest
needs: detect
+ permissions:
+ contents: read
+ packages: write
# Gate at step level: the `matrix` context is not available in a job-level
# `if`, so each step checks whether this image changed (or a full build was
# requested). Unchanged images spin an empty job and exit fast.