Repository navigation
Container tests: check out the built SHA; document org scope (#37) - #42
Merged
Merged
Conversation
- M11/M12: on workflow_run, actions/checkout defaults to the default branch,
not the commit that triggered the container build — so tests could run
against a different commit than the one that built the image. Pin the
checkout to `${{ github.event.workflow_run.head_sha || github.sha }}`
(head_sha for workflow_run, github.sha for manual workflow_dispatch).
- test-container.yml: both job checkouts.
- test-containers-lectures.yml: the actions-repo checkout only. The
lecture-repo checkout intentionally stays on its own default branch
(it tracks lecture content, not the container build commit).
- M13: documented that these workflows target the `quantecon` GHCR org and
QuantEcon's public lecture repos by design. github.repository_owner can't be
substituted into the job-level container image because GHCR requires a
lowercase path while the expression preserves the org's casing, so forks
would set the org explicitly.
Closes #37
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the container test workflows triggered via workflow_run so they test against the same commit that built the container image, and it documents that these workflows intentionally target the quantecon GHCR org (i.e., they’re QuantEcon-specific).
Changes:
- Pin
actions/checkoutto${{ github.event.workflow_run.head_sha || github.sha }}soworkflow_runtests use the triggering commit instead of the default branch. - Add workflow header comments documenting the hardcoded
ghcr.io/quantecon/...scope and implications for forks. - Add a corresponding CI note to the changelog.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| CHANGELOG.md | Documents the CI fix so release notes reflect the workflow_run checkout behavior change. |
| .github/workflows/test-container.yml | Pins checkout to the image-building SHA for both full/lean test jobs; documents QuantEcon-only GHCR scope. |
| .github/workflows/test-containers-lectures.yml | Pins the actions-repo checkout to the image-building SHA; documents QuantEcon-only GHCR scope. |
mmcky
added a commit
that referenced
this pull request
Jun 16, 2026
Follow-up to #42: the M13 note explained fork behaviour at length. Forks aren't a concern, so reduce it to a one-line guard that keeps the useful bit — don't substitute github.repository_owner for the hardcoded org (GHCR paths must be lowercase). Co-authored-by: Claude Opus 4.8 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #37 (M11/M12/M13) — the container test workflows ran against the wrong commit on
workflow_run, plus a note on the hardcoded org.M11/M12 — check out the commit that built the image (the real fix)
Both test workflows trigger on
workflow_runafter Build QuantEcon Containers. Forworkflow_runeventsactions/checkoutdefaults to the default branch, not the SHA that triggered the build — so the test files / composite actions could be from a different commit than the one that produced the image under test.Pinned the checkout to:
workflow_run.head_shafor the triggered runs;github.shafor manualworkflow_dispatch.Applied to:
test-container.yml— both job checkouts (full + lean).test-containers-lectures.yml— the actions-repo checkout only. The lecture-repo checkout deliberately keeps its default (it tracks lecture content, which isn't tied to the container build commit).M13 — hardcoded
quanteconorg → documented (not parameterised)I resolved this via the issue's "document it" option rather than substituting
github.repository_owner, because that substitution would actually break: GHCR image paths must be lowercase, butgithub.repository_ownerpreserves the org's casing (QuantEcon), and it can't be lowercased inside a job-levelcontainer.image. The workflows also target QuantEcon's public lecture repos in the matrix, so they're QuantEcon-specific by design. Added a header comment to each workflow explaining this (and what a fork would change).Verification
head_sharef present in both; the lecture-repo checkout confirmed unchanged.Closes #37
🤖 Generated with Claude Code