Repository navigation
Make examples the canonical gallery source - #2
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7c9d84e583
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| push: | ||
| branches: [main] | ||
| paths: ["examples/**"] | ||
| branches: [master] |
There was a problem hiding this comment.
Keep publishing triggers on the main branch
This repository's existing branch is main (the previous workflow also targeted main), so changing the push trigger to master means normal pushes to main will no longer publish the manifest or examples; the same mismatch also prevents PR validation for PRs targeting main via the pull_request branch filter above.
Useful? React with 👍 / 👎.
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 2 |
There was a problem hiding this comment.
Fetch enough history before diffing push ranges
With fetch-depth: 2, a push that contains more than one new commit does not include github.event.before in the checkout, but the script later runs git diff --name-only "$BEFORE" "${{ github.sha }}"; in that common multi-commit push scenario the discover job exits with a bad-object error and nothing gets published. Use full history or otherwise fetch BEFORE before diffing.
Useful? React with 👍 / 👎.
| slug, | ||
| title: requiredString(meta.title, "title", slug), | ||
| name: requiredString(meta.name, "name", slug), | ||
| vertical: requiredString(meta.vertical, "vertical", slug), |
There was a problem hiding this comment.
Point manifest repo links at the real branch
The generated feed now hard-codes every example's repoUrl under /tree/master/..., but this repo only has main as the canonical branch, so the gallery will emit broken source links for every example instead of linking users to the files that actually exist.
Useful? React with 👍 / 👎.
What changed
Why
The website and a draft badge branch had separate prompt copies. Published examples could therefore carry stale prompts and stale badge behavior. This moves the data contract here and makes the website a consumer.
Verification
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.