Skip to content

Commit 757166c

Browse files
authored
chore(repo): Add backport script (clerk#1959)
* feat(repo): Add backport script * chore(repo): Add instructions * chore(repo): Fix linting
1 parent 9c6411a commit 757166c

8 files changed

+491
-5
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,6 @@ test-results
8484

8585
# verdaccio
8686
.verdaccio
87+
88+
scripts/.env
89+
!scripts/.env.example

.lintstagedrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"*.{js,jsx,ts,tsx}": ["npx prettier --write", "npx eslint --fix"],
2+
"*.{mjs,js,jsx,ts,tsx}": ["npx prettier --write", "npx eslint --fix"],
33
"*.{json,md,mdx}": ["npx prettier --write"]
44
}

docs/PUBLISH.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
_Note: Only core maintainers can publish packages._
44

5-
_Package versioning and publishing is currently handled by @clerkinc/frontend-team._
6-
75
## Publishing stable package versions (`@latest`)
86

97
We are using [changesets](https://github.com/changesets/changesets), so our CICD is using [`changesets/action`](https://github.com/changesets/action) to automate the release process when releasing stable package versions targeting the `@latest` tag.
@@ -42,3 +40,17 @@ Notes:
4240
## Publishing canary package versions (`@canary`)
4341

4442
We're still considering whether switching the repo into a `canary` mode for big, experimental features makes sense. There is no use case for this right now, however, we might experiment with the [changesets prerelease mode](https://github.com/changesets/changesets/blob/main/docs/prereleases.md) in the future.
43+
44+
## Backporting PRs
45+
46+
> Backporting is the action of taking parts from a newer version of a software system or software component and porting them to an older version of the same software.
47+
48+
If a PR got merged into `main` that should also be released in older versions (e.g. critical security fixes), you'll need to backport said PR. You can do this by using the [`backport` script](https://github.com/clerkinc/javascript/blob/main/scripts/backport.mjs) inside `scripts`.
49+
50+
Duplicate the `.env.example` file inside `scripts` and rename it to `.env`. Fill out the `GITHUB_ACCESS_TOKEN` variable. Afterwards, you'll be able to run the CLI like so:
51+
52+
```shell
53+
node backports.mjs main-v4 1234
54+
```
55+
56+
The command above will backport the PR `1234` to the branch `main-v4`.

0 commit comments

Comments
 (0)