ci: auto-create changeset for dependabot PRs#582
Conversation
Agent-Logs-Url: https://github.com/cameri/nostream/sessions/d4c27474-5e00-4668-ab36-b9ffe83a3c96 Co-authored-by: cameri <378886+cameri@users.noreply.github.com>
|
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Actions workflow intended to automatically create a Changesets entry on Dependabot PRs so they pass the repo’s “Changeset Required” CI check.
Changes:
- Introduces
.github/workflows/dependabot-changeset.ymlto generate a patch changeset fornostreamusing the PR title. - Commits and pushes the generated
.changeset/dependabot-pr-<number>.mdback onto the Dependabot PR branch.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Check for existing changeset | ||
| id: check | ||
| run: | | ||
| count=$(find .changeset -maxdepth 1 -name '*.md' ! -name 'README.md' 2>/dev/null | wc -l) | ||
| if [ "$count" -gt 0 ]; then | ||
| echo "exists=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "exists=false" >> "$GITHUB_OUTPUT" | ||
| fi |
There was a problem hiding this comment.
The "Check for existing changeset" step is checking whether any .changeset/*.md file exists in the repo, which will be true on branches created from main (this repo already contains many changesets). As a result, exists will almost always be true and the workflow will never create a changeset for Dependabot PRs.
Instead, detect whether the PR introduces a changeset relative to the base branch (e.g. reuse the same logic as CI: pnpm exec changeset status --since origin/${{ github.base_ref }}), or at least check for the presence of the specific file you intend to create (.changeset/dependabot-pr-<number>.md).
|
@copilot The "Check for existing changeset" step is checking whether any .changeset/*.md file exists in the repo, which will be true on branches created from main (this repo already contains many changesets). As a result, exists will almost always be true and the workflow will never create a changeset for Dependabot PRs. Instead, detect whether the PR introduces a changeset relative to the base branch (e.g. reuse the same logic as CI: pnpm exec changeset status --since origin/${{ github.base_ref }}), or at least check for the presence of the specific file you intend to create (.changeset/dependabot-pr-.md). |
Agent-Logs-Url: https://github.com/cameri/nostream/sessions/3207702c-8940-4b51-a9b7-39d3c4bedcf4 Co-authored-by: cameri <378886+cameri@users.noreply.github.com>
Fixed in 83ee5c9 — the check now tests specifically for |
.github/workflows/dependabot-changeset.ymlworkflow that:openedandreopenedpull_request events fromdependabot[bot].changeset/dependabot-pr-<number>.mdalready exists (the specific file it creates)"nostream": patchbump and PR title as description