Skip to content

Commit 7271454

Browse files
committed
feat(github): add cheatsheet to a pr description
1 parent 7213cc7 commit 7271454

File tree

2 files changed

+123
-0
lines changed

2 files changed

+123
-0
lines changed

packages/github/src/cheatsheet.ts

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
export const CHEATSHEET = `
2+
3+
You can configure the bot's behavior through a pull request comment using the \`!simple-release/set-options\` command.
4+
5+
### Command Format
6+
7+
\`\`\`\`md
8+
!simple-release/set-options
9+
10+
\`\`\`json
11+
{
12+
"bump": {},
13+
"publish": {}
14+
}
15+
\`\`\`
16+
\`\`\`\`
17+
18+
### Useful Parameters
19+
20+
#### Bump
21+
22+
| Parameter | Type | Description |
23+
|-----------|------|-------------|
24+
| \`version\` | \`string\` | Force set specific version |
25+
| \`as\` | \`'major' \\| 'minor' \\| 'patch' \\| 'prerelease'\` | Release type |
26+
| \`prerelease\` | \`string\` | Pre-release identifier (e.g., "alpha", "beta") |
27+
| \`byProject\` | \`Record<string, object>\` | Per-project bump options for monorepos |
28+
| \`firstRelease\` | \`boolean\` | Whether this is the first release |
29+
| \`skip\` | \`boolean\` | Skip version bump |
30+
| \`force\` | \`boolean\` | Ignore that project is private |
31+
32+
#### Publish
33+
34+
| Parameter | Type | Description |
35+
|-----------|------|-------------|
36+
| \`access\` | \`'public' \\| 'restricted'\` | Package access level |
37+
| \`tag\` | \`string\` | Tag for npm publication |
38+
39+
### Usage Examples
40+
41+
#### Force specific version
42+
43+
\`\`\`\`md
44+
!simple-release/set-options
45+
46+
\`\`\`json
47+
{
48+
"bump": {
49+
"version": "2.0.0"
50+
}
51+
}
52+
\`\`\`
53+
\`\`\`\`
54+
55+
#### Force major bump
56+
57+
\`\`\`\`md
58+
!simple-release/set-options
59+
60+
\`\`\`json
61+
{
62+
"bump": {
63+
"as": "major"
64+
}
65+
}
66+
\`\`\`
67+
\`\`\`\`
68+
69+
#### Create alpha pre-release
70+
71+
\`\`\`\`md
72+
!simple-release/set-options
73+
74+
\`\`\`json
75+
{
76+
"bump": {
77+
"prerelease": "alpha"
78+
}
79+
}
80+
\`\`\`
81+
\`\`\`\`
82+
83+
#### Publish with specific access and tag
84+
85+
\`\`\`\`md
86+
!simple-release/set-options
87+
88+
\`\`\`json
89+
{
90+
"bump": {
91+
"prerelease": "beta"
92+
},
93+
"publish": {
94+
"access": "public",
95+
"tag": "beta"
96+
}
97+
}
98+
\`\`\`
99+
\`\`\`\`
100+
101+
### Access Restrictions
102+
103+
The command can only be used by users with permissions:
104+
- repository owner
105+
- organization member
106+
- collaborator
107+
108+
### Notes
109+
110+
- The last comment with \`!simple-release/set-options\` command takes priority
111+
- JSON must be valid, otherwise the command will be ignored
112+
- Parameters apply only to the current release execution
113+
- The command can be updated by editing the comment or adding a new one
114+
`

packages/github/src/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
type CreatePullRequestOptions,
66
GitRepositoryHosting
77
} from '@simple-release/core'
8+
import { CHEATSHEET } from './cheatsheet.js'
89

910
export { Octokit }
1011

@@ -155,6 +156,14 @@ export class GithubHosting extends GitRepositoryHosting {
155156
---
156157
This PR was generated with [simple-release](https://github.com/TrigenSoftware/simple-release).
157158
159+
<details>
160+
<summary>📄 Cheatsheet</summary>
161+
<br>
162+
163+
${CHEATSHEET}
164+
165+
</details>
166+
158167
<!--
159168
Please do not edit this comment.
160169
simple-release-pull-request: true

0 commit comments

Comments
 (0)