Skip to content

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

Merged
jtcrde merged 5 commits into
masterfrom
feature/TRU-342
Aug 4, 2026
Merged

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

Conversation

@jtcrde

@jtcrde jtcrde commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Pattern-setter PR for TRU-342 — and the first consumer of the new quantum-sec/actions reusable-workflow repo, which deliberately mirrors armor/actions so the org move (TRU-329) becomes an org-name swap in each uses: line.

Changes

  • .github/workflows/ci.yaml (new, ~45 lines) — version-pinned consumers of three reusable workflows from quantum-sec/actions@v1.0.0:
    • terraform-module-validation.yaml — the repo's pre-commit hooks (terraform from .terraform-version, tflint, checksum-verified tfsec) + Checkov. Secret-free; safe on fork PRs.
    • semantic-release.yaml — interface mirrors armor/actions (same secret, same semver output).
    • update-source-reference.yaml — the auto-bump: rewrites this package's ?ref= pins in infrastructure-modules on release (direct GPG-signed push for minor/patch, PR for major).
  • All the security hardening from the TRU-327/342 review lives in the central workflows: strict-semver guards, checksum-verified tooling, no shell tracing (public repo, public logs), least-privilege GITHUB_TOKEN.
  • .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 port — runFunctionalTests was explicitly false, no Go tests exist.

Note for branch protection

With reusable workflows, check names become Validation / Pre-Commit Validation, Validation / Validate, etc. — use those names when making checks required.

Test plan

  • Both validation checks green on this PR (exercising the reusable workflows end to end)
  • Before merge: IMPORT_GPG_KEY, IMPORT_GPG_KEY_PASSPHRASE, QUANTUM_CI_BOT_GITHUB_SSH_KEY added as repo secrets (GIT_TOKEN_BASIC is org-level)
  • After merge: release cut on GHA; the update job rewrites package-pki refs in infrastructure-modules and pushes — flowing through infra-modules' 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.
zhianchow
zhianchow previously approved these changes Jul 31, 2026
This is a public repo: Actions logs are world-readable. set -x traces
every command publicly and turns any accidental echo of a derived value
into a public disclosure. Replace with set -e; the script's deliberate
echo statements provide the useful log output.
Replace the self-contained pipeline with version-pinned consumers of the
central reusable workflows (validation, semantic-release,
update-source-reference) — all logic, hardening included, now lives in
quantum-sec/actions@v1.0.0. The consumer file mirrors what an
armor/actions consumer will look like after the org move: convergence is
an org-name swap.
@jtcrde
jtcrde merged commit 927e9ec into master Aug 4, 2026
8 checks passed
@jtcrde
jtcrde deleted the feature/TRU-342 branch August 4, 2026 07:15
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