Skip to content
Merged
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
15 changes: 2 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,8 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}

# Mutually exclusive with tagging: update the existing version PR, not main.
- name: Sync README on Version Packages PR
if: steps.changesets.outputs['has-changesets'] == 'true'
run: |
git fetch origin changeset-release/main
git checkout -B changeset-release/main origin/changeset-release/main
yarn readme
if ! git diff --quiet -- README.md; then
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add README.md
git commit -m 'docs: sync generated README'
git push origin HEAD:changeset-release/main
fi
# The README is regenerated by the version-packages script, so the
# Version Packages PR commit includes it alongside the version bumps.

# Only the merged version commit has no pending changesets.
- name: Tag released versions
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ After `yarn install`, the `prepare` script runs `husky` and sets `core.hooksPath
| **pre-commit** | `yarn lint-staged` — format + lint staged files; package tests for staged `codemods/**/scripts/*` ([`.lintstagedrc.json`](./.lintstagedrc.json)) |
| **pre-push** | `yarn check:changed` (the `check-changed` bin from [`@backstage/scripts`](./packages/scripts)) — the **same** format / lint / package-name / test gates as CI |

CI (`.github/workflows/ci.yml`) calls that same script, so local and remote gates cannot drift. Run `yarn check:changed` anytime to reproduce CI locally. Codemod PRs do not regenerate or check the root README; leave it unchanged. After codemods land on `main` with changesets, the release workflow regenerates the README on the **Version Packages** PR, so changeset consumption, version bumps, and the README update always land together. There is no separate README-sync workflow: if the README drifts without a changeset, regenerate it on the next release PR, or run `yarn readme` locally and commit the result through a normal PR.
CI (`.github/workflows/ci.yml`) calls that same script, so local and remote gates cannot drift. Run `yarn check:changed` anytime to reproduce CI locally. Codemod PRs do not regenerate or check the root README; leave it unchanged. After codemods land on `main` with changesets, the release workflow's `version-packages` script (`changeset version && sync-codemod-versions && generate-readme-codemods`) regenerates the README as part of the same version commit, so changeset consumption, version bumps, and the README update always land together on the **Version Packages** PR. There is no separate README-sync workflow: if the README drifts without a changeset, regenerate it on the next release PR, or run `yarn readme` locally and commit the result through a normal PR.

## Making changes

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"lint:fix": "oxlint --type-aware --type-check --fix --no-error-on-unmatched-pattern --ignore-pattern .worktrees",
"prepare": "husky",
"changeset": "changeset",
"version-packages": "changeset version && sync-codemod-versions",
"version-packages": "changeset version && sync-codemod-versions && generate-readme-codemods",
"readme": "generate-readme-codemods",
"check:changed": "check-changed",
"tag-and-publish": "tag-and-publish"
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/tests/wiring.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test('release workflow calls the bins', () => {

test('root package.json scripts and devDependency use the bins', () => {
const manifest = JSON.parse(read('package.json')) as { scripts: Record<string, string>; devDependencies: Record<string, string> }
assert.equal(manifest.scripts['version-packages'], 'changeset version && sync-codemod-versions')
assert.equal(manifest.scripts['version-packages'], 'changeset version && sync-codemod-versions && generate-readme-codemods')
assert.equal(manifest.scripts['readme'], 'generate-readme-codemods')
assert.equal(manifest.scripts['check:changed'], 'check-changed')
assert.ok(manifest.devDependencies['@backstage/scripts'] !== undefined)
Expand Down
Loading