Skip to content

TRU-342: Migrate CI/CD from Azure DevOps to GitHub Actions - #5

Open
jtcrde wants to merge 3 commits into
masterfrom
feature/TRU-342
Open

TRU-342: Migrate CI/CD from Azure DevOps to GitHub Actions#5
jtcrde wants to merge 3 commits into
masterfrom
feature/TRU-342

Conversation

@jtcrde

@jtcrde jtcrde commented Jul 31, 2026

Copy link
Copy Markdown

Summary

Pattern-setter PR for TRU-342 — migrating the 11 content-flow module dependency repos to GHA before the org move. package-pki goes first (small, dormant, 3 downstream references); once verified, the same shape stamps out across the other terraform module repos.

Changes

  • .github/workflows/ci.yaml (new), four jobs at parity with the AzDO terraform.yml template:
    • Pre-Commit Validation — all pushes/PRs: terraform fmt, tflint, tfsec, terraform-validate + hygiene hooks (all 16 verified green locally against master, no drift)
    • Validate — Checkov (quiet, soft-fail — same as the AzDO run-ci-analysis step)
    • Release — master only, semantic-release on the @cncsc stack
    • Update infrastructure-modules references — verbatim port of update-source-reference.yml: on a new release, rewrites this package's ?ref= pins in infrastructure-modules — direct GPG-signed push for minor/patch, feature branch + PR for major bumps
  • .releaserc.json / package.json / lockfile@quantum-sec@cncsc semantic-release stack with local devDependencies
  • azure-pipelines.yml deleted in the same commit (the npm-link rule from TRU-327)
  • No terratest portrunFunctionalTests was explicitly false and the repo has no Go tests

Test plan

  • Pre-Commit Validation + Validate green on this PR
  • Verify secrets visible to this repo before merge: GIT_TOKEN_BASIC, QUANTUM_CI_BOT_GITHUB_SSH_KEY, IMPORT_GPG_KEY(+_PASSPHRASE) — the update job needs all four (same set just verified working on infrastructure-live-customer)
  • After merge: release cut on GHA; the update job rewrites package-pki refs in infrastructure-modules and pushes (minor/patch) — which then flows through infra-modules' own import-gated, validated release chain
  • Flag the quantum-sec.package-pki AzDO pipeline definition to the org owners for deletion

Pattern-setter for the content-flow module dependency repos.

- Add .github/workflows/ci.yaml with four jobs mirroring the AzDO
  terraform.yml template: pre-commit (fmt/tflint/tfsec/validate +
  hygiene hooks), Checkov validate, semantic-release on master, and a
  verbatim port of update-source-reference — the automation that
  rewrites this package's ?ref= pins in infrastructure-modules on each
  release (direct push for minor/patch, feature branch + PR for major).
- Switch .releaserc.json to @cncsc/semantic-release-config and add the
  matching devDependencies (previously provided globally by the CI
  container).
- Delete azure-pipelines.yml in the same commit so AzDO's npm link
  step never runs against the local semantic-release stack (the
  v19/v21 EPERM collision documented on TRU-327).
- No terratest port: runFunctionalTests was explicitly false and the
  repo has no Go test files.
@jtcrde
jtcrde requested a review from a team as a code owner July 31, 2026 08:26
jtcrde added 2 commits July 31, 2026 16:35
Checkov CKV2_GHA_1: without a top-level permissions block the workflow
inherits the repository's default GITHUB_TOKEN grant (write-all on the
legacy default). Default to contents: read; the release job elevates to
contents: write explicitly. The real credentials in these jobs come from
GIT_TOKEN_BASIC, so nothing loses access.
…um (fix)

Security-review findings on the pattern:
- LATEST_VERSION comes from git tag names, which may legally contain
  sed/content metacharacters and are later interpolated into sed
  expressions that write into infrastructure-modules (pushed as signed
  bot commits). Require strict semver before using the value anywhere.
- Verify the tfsec binary against its official release sha256 instead
  of trusting the download blindly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants