Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/changeset-generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,75 @@ You can test the release notes generation locally by running:
npm run release:notes
```

### Generating Changesets Locally

You can generate changesets locally for previously merged PRs using either the npm script or the Node.js script directly:

```bash
# Using the npm script (note the -- before the arguments)
npm run changeset:generate -- --pr=123 --title="feat: Add new feature" --author="username"

# With a detailed body
npm run changeset:generate -- \
--pr=123 \
--title="feat: Add new feature" \
--author="username" \
--body="Detailed description of the changes"

# For a breaking change
npm run changeset:generate -- \
--pr=123 \
--title="feat!: Breaking change" \
--author="username" \
--breaking=true

# Or using Node directly
node scripts/generate-changeset.js \
--pr=123 \
--title="feat: Add new feature" \
--author="username"
```

You can also use the GitHub API to fetch PR information automatically:

```bash
# Set your GitHub token
export GITHUB_TOKEN="your_token_here"

# Fetch PR info and generate changeset
PR_NUMBER=123
PR_DATA=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/$OWNER/$REPO/pulls/$PR_NUMBER")

# Using npm script
npm run changeset:generate -- \
--pr="$PR_NUMBER" \
--title="$(echo "$PR_DATA" | jq -r '.title')" \
--author="$(echo "$PR_DATA" | jq -r '.user.login')" \
--body="$(echo "$PR_DATA" | jq -r '.body')"

# Or using Node directly
node scripts/generate-changeset.js \
--pr="$PR_NUMBER" \
--title="$(echo "$PR_DATA" | jq -r '.title')" \
--author="$(echo "$PR_DATA" | jq -r '.user.login')" \
--body="$(echo "$PR_DATA" | jq -r '.body')"
```

Available options:
- `--pr`: (required) The PR number
- `--title`: (required) The PR title
- `--author`: (required) The PR author's username
- `--body`: (optional) The PR description
- `--breaking`: (optional) Whether this is a breaking change [default: false]

After generating the changeset:
1. Commit the new changeset file in the `.changesets` directory
2. Push the changes to the develop branch
3. The workflow will automatically update or create a release PR

### Other Local Testing Options

For JSON output (used in PR descriptions):

```bash
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Automation Tests
test# Automation Tests

This repository contains tests and examples for automating various aspects of WordPress plugin development, including:

Expand Down
Loading