Skip to content

Commit ebc69c6

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

File tree

2 files changed

+116
-0
lines changed

2 files changed

+116
-0
lines changed

packages/github/src/cheatsheet.ts

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

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)