Skip to content

support custom paths in Git context - #729

Merged
crazy-max merged 2 commits into
docker:masterfrom
crazy-max:git-working-directory
Sep 15, 2026
Merged

crazy-max merged 2 commits into
docker:masterfrom
crazy-max:git-working-directory

Conversation

@crazy-max

Copy link
Copy Markdown
Member

follow-up docker/actions-toolkit#1314
fixes #616
closes #310

Allow context: git:<path> to read the Git ref, SHA, and commit date from a checkout in a custom directory, including submodules. Repository metadata continues to come from the workflow repository.

Also adds regression coverage for detached checkouts without named refs from docker/actions-toolkit#1313

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max
crazy-max requested a review from a team September 15, 2026 10:30
@crazy-max
crazy-max marked this pull request as ready for review September 15, 2026 10:30
@vvoland
vvoland requested a balanced review from Copilot September 15, 2026 11:14

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.

🟢 Approval recommended

The implementation correctly propagates custom working directories and includes focused regression coverage.

Pull request overview

Adds custom checkout-path support for Git-based metadata while retaining workflow repository metadata.

Changes:

  • Supports context: git:<path> for custom directories and submodules.
  • Adds custom-path and detached-checkout regression tests.
  • Documents the new context syntax.
File summaries
File Description
src/context.ts Parses custom Git paths and forwards them to Git helpers.
README.md Documents git:<path> with an example.
action.yml Updates the input description.
__tests__/context.test.ts Tests path handling and detached checkouts.
__tests__/fixtures/repo.json Updates repository metadata fixtures.
Review details
  • Files reviewed: 5/7 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@crazy-max
crazy-max merged commit 8e671d8 into docker:master Sep 15, 2026
42 checks passed
@crazy-max
crazy-max deleted the git-working-directory branch September 15, 2026 11:40
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.

metadata actions supports context git, but seems to assume checkout action doesn't use path input. Feature request: git submodule context

3 participants