You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+62-17Lines changed: 62 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ your repository.
59
59
60
60
### Modify the Pull Request Template
61
61
62
-
By default, this action will append the visualization to the bottom of the PR description.
62
+
By default, the action will append the visualization to the bottom of the PR description.
63
63
If you are using a [pull request template](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository),
64
64
you can specify the location of the visualization in the template by adding a [HTML comment](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#hiding-content-with-comments)
65
65
that contains `branch-stack` inside of it:
@@ -76,7 +76,7 @@ that contains `branch-stack` inside of it:
76
76
[ ] Baz
77
77
```
78
78
79
-
This action will look for this comment and insert the visualization underneath the comment
79
+
The action will look for this comment and insert the visualization underneath the comment
80
80
when it runs. It will also leave behind the comment, so that the next time it runs, it will
81
81
be able to use it again to update the visualization:
82
82
@@ -98,17 +98,17 @@ be able to use it again to update the visualization:
98
98
99
99
> [!WARNING]
100
100
> Be careful not to add content between the comment and the
101
-
> visualization, as this action will replace that content each time it
101
+
> visualization, as the action will replace that content each time it
102
102
> updates your PR. Adding content above the tag, or below the list is
103
103
> safe though!
104
104
105
-
###Manual Configuration
105
+
## Manual Configuration
106
106
107
-
If you are using Git Town v11 and below, or are setting up this action for a repository
108
-
that doesn't have a `.git-branches.toml`, you will need to tell this action what the
107
+
If you are using Git Town v11 and below, or are setting up the action for a repository
108
+
that doesn't have a `.git-branches.toml`, you will need to tell the action what the
109
109
main branch and perennial branches are for your repository.
110
110
111
-
####Main Branch
111
+
### Main Branch
112
112
113
113
The main branch is the default parent branch for new feature branches, and can be
114
114
specified using the `main-branch` input:
@@ -119,10 +119,10 @@ specified using the `main-branch` input:
119
119
main-branch: 'main'
120
120
```
121
121
122
-
This action will default to your repository's default branch, which it fetches via
122
+
The action will default to your repository's default branch, which it fetches via
123
123
the GitHub REST API.
124
124
125
-
#### Perennial Branches
125
+
### Perennial Branches
126
126
127
127
Perennial branches are long lived branches and are never shipped.
128
128
@@ -139,25 +139,70 @@ be done with the `perennial-branches` and `perennial-regex` inputs respectively:
139
139
perennial-regex: '^release-.*$'
140
140
```
141
141
142
-
Both inputs can be used at the same time. This action will merge the perennial
142
+
Both inputs can be used at the same time. The action will merge the perennial
143
143
branches given into a single, de-duplicated list.
144
144
145
-
#### Skip Single Stacks
145
+
## Customization
146
146
147
-
If you don't want the stack description to appear on pull requests which are not part of a stack, you can add `skip-single-stacks: true` to the job.
147
+
### Skip Single Stacks
148
148
149
-
This skips all pull requests which point to a main or perennial branch and have no children pull requests pointing to it.
149
+
If you don't want the stack visualization to appear on pull requests which are **not** part
150
+
of a stack, add `skip-single-stacks: true` to the action's inputs.
151
+
152
+
A pull request is considered to be **not** a part of a stack if:
153
+
- It has no child pull requests.
154
+
- It's parent is the main branch or a perennial branch.
150
155
151
156
```yaml
152
157
- uses: git-town/action@v1
153
158
with:
154
-
perennial-branches: |
155
-
dev
156
-
staging
157
-
prod
158
159
skip-single-stacks: true
159
160
```
160
161
162
+
### History Limit
163
+
164
+
In order to accurately visualize stacked changes, the action needs to fetch _all_ open
165
+
and closed pull requests. This can problematic for larger/older repositories that have
166
+
a large number of closed pull requests.
167
+
168
+
The action can be configured to fetch a limited number of closed pull requests. This is
169
+
customizable with the `history-limit` input:
170
+
171
+
```yaml
172
+
- uses: git-town/action@v1
173
+
with:
174
+
history-limit: '500' # Only fetch the latest 500 closed pull requests
175
+
```
176
+
177
+
> [!NOTE]
178
+
> This only applies to closed pull requests. Open pull requests will be completely fetched
179
+
> regardless of the `history-limit`.
180
+
181
+
## Reference
182
+
183
+
```yaml
184
+
inputs:
185
+
github-token:
186
+
required: true
187
+
default: ${{ github.token }}
188
+
main-branch:
189
+
required: false
190
+
default: ''
191
+
perennial-branches:
192
+
required: false
193
+
default: ''
194
+
perennial-regex:
195
+
required: false
196
+
default: ''
197
+
skip-single-stacks:
198
+
required: false
199
+
default: false
200
+
history-limit:
201
+
required: false
202
+
default: '0'
203
+
```
204
+
205
+
161
206
## License
162
207
163
208
The scripts and documentation in this project are released under the [MIT License](LICENSE).
0 commit comments