Skip to content

Harden CI workflows#209

Merged
tamalsaha merged 6 commits into
masterfrom
switch-to-lgtm-app-token
May 19, 2026
Merged

Harden CI workflows#209
tamalsaha merged 6 commits into
masterfrom
switch-to-lgtm-app-token

Conversation

@tamalsaha
Copy link
Copy Markdown
Member

@tamalsaha tamalsaha commented May 19, 2026

Summary

Apply the CI hardening pattern from appscode-cloud/installer#1252.

  • release-tracker.yml: switch to the LGTM GitHub App token (owner appscode-cloud, repositories CHANGELOG). Drop the legacy Prepare git + Install hub steps and the LGTM_GITHUB_TOKEN PAT. hack/scripts/update-release-tracker.sh: hub apigh api.
  • release.yml:
    • Bump actions/checkout from @v1 to 34e1148… (v4.3.1).
    • Add least-privilege job-level permissions: { contents: write, packages: write }.
    • Pin actions/setup-node, actions/setup-python, docker/setup-qemu-action, docker/setup-buildx-action, docker/login-action to commit SHAs.
    • Replace inline docker login + LGTM_GITHUB_TOKEN PAT with docker/login-action@v4.1.0 using github.actor and the default GITHUB_TOKEN.
    • Drop the unused Prepare git step (make release only does docker push, no git ops need the rewrite).
    • Drop the unused Install GitHub CLI (hub) step (folded from Drop unused hub CLI install from release workflow #210).
  • release_old.yml: SHA-pin actions; fetch-depth: 1 + fetch-tags: true on the tag-triggered checkout.
  • ci.yml, deploy.yml, preview-website.yml: SHA-pin all actions (incl. FirebaseExtended/action-hosting-deploy@v0e2eda2e… v0.10.0). Drop unused GOOGLE_CUSTOM_SEARCH_API_KEY env from preview-website.yml.
  • Bump actions/setup-node to Node 22 across ci.yml, deploy.yml, preview-website.yml, release.yml, release_old.yml (Node 20 is approaching EOL).

Closes #210 (its commit was merged into this branch).

Test plan

  • CI passes on this PR.
  • After merge, next merged PR triggers release-tracker and the comment lands on the CHANGELOG release tracker.
  • Next tag triggers release and release_old; both succeed (ghcr.io push via GITHUB_TOKEN, deploy-to-linode).
  • Next PR triggers preview-website and the Firebase preview lands.

kodiakhq[bot]
kodiakhq Bot previously approved these changes May 19, 2026
kodiakhq[bot]
kodiakhq Bot previously approved these changes May 19, 2026
kodiakhq[bot]
kodiakhq Bot previously approved these changes May 19, 2026
@tamalsaha tamalsaha changed the title Switch release-tracker to LGTM App token Harden CI workflows May 19, 2026
kodiakhq[bot]
kodiakhq Bot previously approved these changes May 19, 2026
kodiakhq[bot]
kodiakhq Bot previously approved these changes May 19, 2026
tamalsaha added 6 commits May 19, 2026 23:54
Mirror the image-packer template: drop the legacy PAT-based
LGTM_GITHUB_TOKEN, prepare-git, and hub install steps. The
update-release-tracker.sh script no longer needs to push, so
git config is unnecessary; switched its hub api call to gh api,
which is preinstalled on GitHub-hosted runners.

Signed-off-by: Tamal Saha <tamal@appscode.com>
The release workflow installed the legacy hub CLI but nothing in
the workflow, Makefile, or release scripts invokes hub. gh ships
preinstalled on GitHub-hosted runners if a future step needs it.

Signed-off-by: Tamal Saha <tamal@appscode.com>
Apply the appscode-cloud/installer#1252 hardening pattern.

- Pin every action to a full-length commit SHA with a version comment
  (actions/checkout, actions/setup-node, actions/setup-python,
  actions/setup-go, docker/setup-qemu-action, docker/setup-buildx-action,
  FirebaseExtended/action-hosting-deploy).
- release.yml: bump actions/checkout from v1 to v4.3.1; tag-triggered
  job now uses fetch-depth: 1 + fetch-tags: true so the tag ref resolves
  without a full clone; add least-privilege job-level permissions
  (contents: write, packages: write); drop the LGTM_GITHUB_TOKEN PAT
  for the Prepare git step and the in-repo git env in the Publish step
  (use github.actor + GITHUB_TOKEN). Keep LGTM_GITHUB_TOKEN as the
  ghcr.io docker password since publishing to the appscode org packages
  requires cross-org write access. Drop the unused hub CLI install
  step.
- release_old.yml: fetch-depth: 1 + fetch-tags: true for the tag ref.

Signed-off-by: Tamal Saha <tamal@appscode.com>
- Bump actions/setup-node to Node 22 across ci, deploy, preview-website, release, release_old.
- release.yml: replace inline `docker login` + `LGTM_GITHUB_TOKEN` PAT with `docker/login-action@v4.1.0` using `github.actor` and the default `GITHUB_TOKEN` (job already has `packages: write`).
- preview-website.yml: drop unused `GOOGLE_CUSTOM_SEARCH_API_KEY` env from the build step.

Signed-off-by: Tamal Saha <tamal@appscode.com>
`make release` only does docker push (via docker/login-action) — no git
operations need the user.name / insteadOf rewrite the step was setting up.

Signed-off-by: Tamal Saha <tamal@appscode.com>
FirebaseExtended/action-hosting-deploy posts a check run + PR comment.
With no job-level `permissions:` block the GITHUB_TOKEN inherits the
repo's restricted default, so the action's `POST /check-runs` call
returns 403 "Resource not accessible by integration"
(x-accepted-github-permissions: checks=write).

Signed-off-by: Tamal Saha <tamal@appscode.com>
@tamalsaha tamalsaha force-pushed the switch-to-lgtm-app-token branch from e5e5199 to 40206dc Compare May 19, 2026 17:54
@github-actions
Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 40206dc):

https://appscode-v3-hugo--pr209-switch-to-lgtm-app-t-4isdgl20.web.app

(expires Tue, 26 May 2026 17:56:39 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 1720b7810a846fabdac7ca3b944d0f3a577e94de

@tamalsaha tamalsaha merged commit 9584ecc into master May 19, 2026
6 checks passed
@tamalsaha tamalsaha deleted the switch-to-lgtm-app-token branch May 19, 2026 17:57
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.

1 participant