Skip to content

Commit 82cf484

Browse files
committed
chore(github-action): fix action run
1 parent 21ff057 commit 82cf484

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

packages/github-action/src/releaser.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)