- Notifications
You must be signed in to change notification settings - Fork0
Visualizes your stacked changes when proposing pull requests on GitHub
License
coldrun/git-town-action
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This action visualizes your stacked changes when proposing pull requests on GitHub:
This allows you to easily see all related PRs for a given pull request, whereyou are in the stack, as well as navigate between PRs in a stack.
It is designed to work out of the box withGit Town v12+,but also supports previous versions viamanual configuration.
Please refer to therelease page forthe latest release notes.
Create a workflow file calledgit-town.yml
under.github/workflows
with the followingcontents:
name:Git Townon:pull_request:branches: -'**'jobs:git-town:name:Display the branch stackruns-on:ubuntu-latestpermissions:contents:readpull-requests:writesteps: -uses:actions/checkout@v4 -uses:git-town/action@v1
Once this workflow is committed, the action will visualize your stacked changeswhenever a pull request is created or updated. It also will automatically readyour.git-branches.toml
file to determine the main and perennial branches foryour repository.
By default, this action will append the visualization to the bottom of the PR description.If you are using apull request template,you can specify the location of the visualization in the template by adding aHTML commentthat containsbranch-stack
inside of it:
##Stack<!-- branch-stack-->##Checklist[] Foo[] Bar[] Baz
This action will look for this comment and insert the visualization underneath the commentwhen it runs. It will also leave behind the comment, so that the next time it runs, it willbe able to use it again to update the visualization:
##Stack<!-- branch-stack--> 👈 Still there!-`main`-\#1:point_left:-\#2##Checklist[] Foo[] Bar[] Baz
Warning
Be careful not to add content between the comment and thevisualization, as this action will replace that content each time itupdates your PR. Adding content above the tag, or below the list issafe though!
If you are using Git Town v11 and below, or are setting up this action for a repositorythat doesn't have a.git-branches.toml
, you will need to tell this action what themain branch and perennial branches are for your repository.
The main branch is the default parent branch for new feature branches, and can bespecified using themain-branch
input:
-uses:git-town/action@v1with:main-branch:'main'
This action will default to your repository's default branch, which it fetches viathe GitHub REST API.
Perennial branches are long lived branches and are never shipped.
There are two ways to specify perennial branches: explicitly or via regex. This canbe done with theperennial-branches
andperennial-regex
inputs respectively:
-uses:git-town/action@v1with:perennial-branches:| dev staging prodperennial-regex:'^release-.*$'
Both inputs can be used at the same time. This action will merge the perennialbranches given into a single, de-duplicated list.
If you don't want the stack description to appear on pull requests which are not part of a stack, you can addskip-single-stacks: true
to the job.
This skips all pull requests which point to a main or perennial branch and have no children pull requests pointing to it.
-uses:git-town/action@v1with:perennial-branches:| dev staging prodskip-single-stacks:true
The scripts and documentation in this project are released under theMIT License.
About
Visualizes your stacked changes when proposing pull requests on GitHub
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Languages
- TypeScript93.2%
- JavaScript6.8%