Skip to content

ci: harden main.yml workflow against supply-chain risks#1306

Open
erickcestari wants to merge 1 commit into
lightninglabs:masterfrom
erickcestari:harden-ci-workflow
Open

ci: harden main.yml workflow against supply-chain risks#1306
erickcestari wants to merge 1 commit into
lightninglabs:masterfrom
erickcestari:harden-ci-workflow

Conversation

@erickcestari

Copy link
Copy Markdown

Apply least-privilege and standard hardening to the CI workflow:

  • Set top-level permissions: contents: read so GITHUB_TOKEN no longer defaults to broad read/write across the repo.
  • Pass github.base_ref and github.repository via env vars in the check-commits job to prevent shell injection via expression interpolation in run: blocks.
  • Pin third-party jpribyl/action-docker-layer-caching to a full commit SHA so a tag retag cannot swap in unreviewed code.
  • Bump actions/checkout@v3 to @v4 in sqlc-check for consistency with the rest of the workflow.
  • Use yarn install --frozen-lockfile for all dependency installs so CI fails on lockfile drift instead of silently resolving new package versions.

Apply least-privilege and standard hardening to the CI workflow:

- Set top-level `permissions: contents: read` so `GITHUB_TOKEN` no
  longer defaults to broad read/write across the repo.
- Pass `github.base_ref` and `github.repository` via env vars in the
  `check-commits` job to prevent shell injection via expression
  interpolation in `run:` blocks.
- Pin third-party `jpribyl/action-docker-layer-caching` to a full
  commit SHA so a tag retag cannot swap in unreviewed code.
- Bump `actions/checkout@v3` to `@v4` in `sqlc-check` for consistency
  with the rest of the workflow.
- Use `yarn install --frozen-lockfile` for all dependency installs so
  CI fails on lockfile drift instead of silently resolving new
  package versions.
@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@ViktorT-11 ViktorT-11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, looks good to me 🎉!

@ViktorT-11
ViktorT-11 requested a review from ellemouton May 25, 2026 17:22
@lightninglabs-deploy

Copy link
Copy Markdown

@ellemouton: review reminder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants