File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,51 @@ You can test the release notes generation locally by running:
203203npm 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+
206251For JSON output (used in PR descriptions):
207252
208253``` bash
You can’t perform that action at this time.
0 commit comments