Skip to content

Expose GIT_COMMIT in next-base's runtime stage - #1

Merged
miguelcolmenares merged 3 commits into
mainfrom
feature/expose-git-commit-in-next-base
Sep 10, 2026
Merged

Expose GIT_COMMIT in next-base's runtime stage#1
miguelcolmenares merged 3 commits into
mainfrom
feature/expose-git-commit-in-next-base

Conversation

@miguelcolmenares

Copy link
Copy Markdown
Member

Summary

  • next-base's runtime stage now declares ARG GIT_COMMIT=unknown and bakes it into ENV GIT_COMMIT, so a plain FROM next-base doesn't leave the var unset.
  • Documents in the top-level README that a consuming site's own Dockerfile must re-declare ARG GIT_COMMIT / ENV GIT_COMMIT=$GIT_COMMIT (an ARG doesn't propagate through a downstream FROM) and pass --build-arg GIT_COMMIT=$CODEBUILD_RESOLVED_SOURCE_VERSION from its own buildspec.
  • This is the Docker-side half of @silverassist/nextjs-core@0.4.0's new environment subpath, which ships the /api/deploy-info route that reads this var back at runtime — lets a developer without AWS access confirm which commit is live on an environment.

Test plan

  • Reviewed the Dockerfile diff by hand; ARG/ENV placement matches the existing IMAGE_VERSION/VCS_REF/BUILD_DATE pattern in the same stage
  • No image build was run locally (this repo builds via CI on tag/release) — first real build will confirm GIT_COMMIT=unknown bakes correctly with no site override

Bakes a safe GIT_COMMIT=unknown default into the runtime stage so a plain
FROM next-base doesn't leave the var unset. A consuming site's own
Dockerfile re-declares ARG/ENV GIT_COMMIT with its real build-arg, and
reads it back via @silverassist/nextjs-core/environment's /api/deploy-info
route -- lets a developer without AWS access confirm which commit is
live on an environment.
Copilot AI lite review requested due to automatic review settings September 10, 2026 19:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

aquasecurity/trivy-action@0.28.0 never existed as a ref -- upstream only
tags "v0.28.0" -- so build-and-scan failed at Set up job before touching
Docker, on every PR and the weekly schedule alike (confirmed against
main's last scheduled run). Pins by commit SHA instead of the tag,
matching this repo's own "everything external pinned by digest" rule.

Also adds DL3006 to .hadolint.yaml's ignore list: next-base's
FROM ${NODE_IMAGE} can't be statically resolved by hadolint, but
NODE_IMAGE's own default is already version+digest-pinned.
v0.28.0 (once its own tag reference was fixed) still failed at Set up
job: its action.yaml pins aquasecurity/setup-trivy@v0.2.1, a tag
upstream has since deleted -- nothing in this repo can fix that.
v0.36.0 pins setup-trivy@v0.2.6, confirmed to exist, and all the inputs
this workflow passes (image-ref, format, output, severity,
ignore-unfixed) are still present in its action.yaml.
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@miguelcolmenares
miguelcolmenares merged commit 9deb0a8 into main Sep 10, 2026
7 checks passed
@miguelcolmenares
miguelcolmenares deleted the feature/expose-git-commit-in-next-base branch September 10, 2026 19:14
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.

3 participants