Skip to content

Harden CI workflows#259

Merged
tamalsaha merged 21 commits into
masterfrom
nolgtm
May 15, 2026
Merged

Harden CI workflows#259
tamalsaha merged 21 commits into
masterfrom
nolgtm

Conversation

@tamalsaha

Copy link
Copy Markdown
Member

Summary

Tighten the GitHub Actions workflows in this repo so they no longer depend on a long-lived LGTM_GITHUB_TOKEN PAT, and bring them in line with GitHub's hardening guidance.

  • Use the default GITHUB_TOKEN instead of a PAT for in-repo operations. GITHUB_USER switches to github.actor.
  • Scope GITHUB_TOKEN to least privilege at the job level. release-tracker.yml gets contents: write so the token can push commits/tags back to this repo.
  • Pin every action to a full-length commit SHA with a trailing version comment, so floating tags like @v4 can't be silently re-pointed.
  • Tag-triggered workflows now check out with fetch-depth: 1 + fetch-tags: true so the tag ref resolves without a full clone.
  • Bump outdated actions/checkout@v1 to @v4.3.1 where it appeared.

Test plan

  • CI passes on this PR.
  • Confirm release-tracker continues to push commits/tags on PR close.
  • Confirm release.yml still functions on the next tag.

🤖 Generated with Claude Code

tamalsaha added 2 commits May 11, 2026 23:46
Signed-off-by: Tamal Saha <tamal@appscode.com>
- Pin every action ref to a full-length commit SHA with a trailing
  version comment, so floating tags like @v4 can't be re-pointed at
  malicious code.
- Bump outdated actions/checkout@v1 to @v4.3.1 (where present).
- Tag-triggered workflows now check out with fetch-depth: 1 and
  fetch-tags: true so the tag ref is available downstream.
- release-tracker.yml grants contents: write at the job level so the
  default GITHUB_TOKEN can push commits/tags back to the repo.

Signed-off-by: Tamal Saha <tamal@appscode.com>
kodiakhq[bot]
kodiakhq Bot previously approved these changes May 11, 2026
Signed-off-by: Tamal Saha <tamal@appscode.com>
kodiakhq[bot]
kodiakhq Bot previously approved these changes May 12, 2026
Signed-off-by: Tamal Saha <tamal@appscode.com>
kodiakhq[bot]
kodiakhq Bot previously approved these changes May 13, 2026
Signed-off-by: Tamal Saha <tamal@appscode.com>
kodiakhq[bot]
kodiakhq Bot previously approved these changes May 13, 2026
Signed-off-by: Tamal Saha <tamal@appscode.com>
kodiakhq[bot]
kodiakhq Bot previously approved these changes May 13, 2026
Signed-off-by: Tamal Saha <tamal@appscode.com>
kodiakhq[bot]
kodiakhq Bot previously approved these changes May 13, 2026
Signed-off-by: Tamal Saha <tamal@appscode.com>
kodiakhq[bot]
kodiakhq Bot previously approved these changes May 13, 2026
Signed-off-by: Tamal Saha <tamal@appscode.com>
kodiakhq[bot]
kodiakhq Bot previously approved these changes May 13, 2026
Signed-off-by: Tamal Saha <tamal@appscode.com>
kodiakhq[bot]
kodiakhq Bot previously approved these changes May 13, 2026
Signed-off-by: Tamal Saha <tamal@appscode.com>
kodiakhq[bot]
kodiakhq Bot previously approved these changes May 14, 2026
Signed-off-by: Tamal Saha <tamal@appscode.com>
kodiakhq[bot]
kodiakhq Bot previously approved these changes May 14, 2026
Signed-off-by: Tamal Saha <tamal@appscode.com>
kodiakhq[bot]
kodiakhq Bot previously approved these changes May 14, 2026
Signed-off-by: Tamal Saha <tamal@appscode.com>
kodiakhq[bot]
kodiakhq Bot previously approved these changes May 14, 2026
Signed-off-by: Tamal Saha <tamal@appscode.com>
kodiakhq[bot]
kodiakhq Bot previously approved these changes May 14, 2026
Signed-off-by: Tamal Saha <tamal@appscode.com>
kodiakhq[bot]
kodiakhq Bot previously approved these changes May 14, 2026
Signed-off-by: Tamal Saha <tamal@appscode.com>
kodiakhq[bot]
kodiakhq Bot previously approved these changes May 14, 2026
Signed-off-by: Tamal Saha <tamal@appscode.com>
kodiakhq[bot]
kodiakhq Bot previously approved these changes May 14, 2026
Signed-off-by: Tamal Saha <tamal@appscode.com>
kodiakhq[bot]
kodiakhq Bot previously approved these changes May 14, 2026
tamalsaha added 2 commits May 15, 2026 11:45
The Run checks step does not install any apt packages; kubectl is
fetched via curl. Removing the no-op apt-get update tightens the
workflow.

Signed-off-by: Tamal Saha <tamal@appscode.com>
- Generate a scoped LGTM App token (contents+pull-requests write)
  instead of using the default GITHUB_TOKEN, which lacks cross-repo
  push access to the installer repository.
- Mask the parsed owner/name derived from the INSTALLER_REPOSITORY
  secret so they do not leak into logs.
- Set http.extraheader via git config before cloning so the token is
  never baked into the remote URL or .git/config.
- Pin GITHUB_USER to 1gtm for consistent attribution on manual
  workflow_dispatch runs.
- Drop the Set up Go step; neither import-crds.sh nor open-pr.sh
  invokes the Go toolchain.

Signed-off-by: Tamal Saha <tamal@appscode.com>
@tamalsaha tamalsaha merged commit c02a92d into master May 15, 2026
4 of 5 checks passed
@tamalsaha tamalsaha deleted the nolgtm branch May 15, 2026 05:46
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