Skip to content

Commit a6de484

Browse files
committed
- update docs to demonstrate local changeset generation
1 parent 4217f3d commit a6de484

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/changeset-generation.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,51 @@ You can test the release notes generation locally by running:
203203
npm run release:notes
204204
```
205205

206+
### Generating Changesets Locally
207+
208+
You can generate changesets locally for previously merged PRs using the `generate-changeset.js` script directly:
209+
210+
```bash
211+
# Basic usage
212+
node scripts/generate-changeset.js --pr=123 --title="feat: Add new feature" --author="username"
213+
214+
# With a detailed body
215+
node scripts/generate-changeset.js \
216+
--pr=123 \
217+
--title="feat: Add new feature" \
218+
--author="username" \
219+
--body="Detailed description of the changes"
220+
221+
# For a breaking change
222+
node scripts/generate-changeset.js \
223+
--pr=123 \
224+
--title="feat!: Breaking change" \
225+
--author="username" \
226+
--breaking=true
227+
```
228+
229+
You can also use the GitHub API to fetch PR information automatically:
230+
231+
```bash
232+
# Fetch PR info and generate changeset
233+
PR_NUMBER=123
234+
PR_DATA=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
235+
"https://api.github.com/repos/OWNER/REPO/pulls/$PR_NUMBER")
236+
237+
node scripts/generate-changeset.js \
238+
--pr="$PR_NUMBER" \
239+
--title="$(echo "$PR_DATA" | jq -r '.title')" \
240+
--author="$(echo "$PR_DATA" | jq -r '.user.login')" \
241+
--body="$(echo "$PR_DATA" | jq -r '.body')"
242+
```
243+
244+
After generating the changeset:
245+
1. Commit the new changeset file in the `.changesets` directory
246+
2. Push the changes to the develop branch
247+
3. The workflow will automatically update or create a release PR
248+
249+
### Other Local Testing Options
250+
206251
For JSON output (used in PR descriptions):
207252

208253
```bash

0 commit comments

Comments
 (0)