File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
packages/github-action/src Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,10 @@ export class ReleaserGithubAction<P extends Project = Project> extends Releaser<
141141 * Run action based on the context.
142142 */
143143 async runAction ( ) {
144- const { logger } = this
144+ const {
145+ logger,
146+ gitClient
147+ } = this
145148
146149 logger . info ( 'run' , 'Detecting action...' )
147150
@@ -157,10 +160,15 @@ export class ReleaserGithubAction<P extends Project = Project> extends Releaser<
157160
158161 if ( isSetOptionsComment !== null ) {
159162 logger . info ( 'run' , 'Action triggered by a pull request comment.' )
160- super . checkout ( isSetOptionsComment , {
161- fetch : true ,
162- force : false
163- } )
163+
164+ const currentBranch = await gitClient . getCurrentBranch ( )
165+
166+ if ( currentBranch !== isSetOptionsComment ) {
167+ super . checkout ( isSetOptionsComment , {
168+ fetch : true ,
169+ force : false
170+ } )
171+ }
164172 } else {
165173 isReleaseCommit = await ifReleaseCommit ( this )
166174 }
You can’t perform that action at this time.
0 commit comments