Skip to content

ci(catalog): default commit_sha to latest foundry-samples@main#423

Merged
Yimin-Jin merged 1 commit into
template/pre-releasefrom
yimin/workflow-default-latest-sha-pre-release
Jun 2, 2026
Merged

ci(catalog): default commit_sha to latest foundry-samples@main#423
Yimin-Jin merged 1 commit into
template/pre-releasefrom
yimin/workflow-default-latest-sha-pre-release

Conversation

@Yimin-Jin

Copy link
Copy Markdown
Collaborator

Why

Cherry-pick of #418 to template/pre-release so the optional
commit_sha behaviour is available on every dispatchable branch
(template/dev via #418, template/stable via #422, template/pre-release via this PR).

Today the Sync Sample Catalog workflow requires the dispatcher to paste
a specific foundry-samples SHA. In practice we almost always want the
tip of main, so the lookup step is friction without value.

What

  • commit_sha input becomes optional (default empty).
  • New Resolve commit SHA step:
    • if input is non-empty, use it verbatim;
    • otherwise call gh api repos/microsoft-foundry/foundry-samples/commits/main and pin to that SHA;
    • validates the result looks like a SHA before passing it downstream.
  • Generate sample catalog reads from steps.resolve-sha.outputs.sha.
  • The pinned SHA + its source (user input vs. resolved-from-main) is echoed
    to `` so reviewers can see what the run targeted.

Verbatim cherry-pick of #418 - no script changes.

Smoke test

YAML lints clean. Functional verification will happen on the next
workflow_dispatch from template/pre-release once this merges.

Make the workflow_dispatch `commit_sha` input optional. When the user leaves it blank, a new `Resolve commit SHA` step queries the GitHub API for the current tip of `microsoft-foundry/foundry-samples@main` and pins the catalog generation to that SHA.

- `commit_sha`: required=false, default empty.

- New step uses `gh api` (default GITHUB_TOKEN, contents:read is enough for a public repo) and validates the result looks like a SHA before using it.

- The pinned SHA + its source (user input vs. resolved-from-main) is echoed to the step summary so reviewers can see what the run targeted.

- `Generate sample catalog` now reads from `steps.resolve-sha.outputs.sha` instead of `inputs.commit_sha` directly.
@Yimin-Jin Yimin-Jin merged commit 2f481d5 into template/pre-release Jun 2, 2026
3 checks passed
@Yimin-Jin Yimin-Jin deleted the yimin/workflow-default-latest-sha-pre-release branch June 2, 2026 04:31
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.

2 participants