Skip to content

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

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

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

Conversation

@Yimin-Jin

Copy link
Copy Markdown
Collaborator

Why

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.

No script changes — the generator still receives a real SHA on its CLI.

Smoke test

YAML lints clean. Functional verification will happen on the next
workflow_dispatch from template/dev 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 4db3b92 into template/dev Jun 2, 2026
4 checks passed
@Yimin-Jin Yimin-Jin deleted the yimin/workflow-default-latest-sha branch June 2, 2026 04:07
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