Skip to content

Commit

Permalink
Skip disabling auto-merge on dry run.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Mar 8, 2023
1 parent 94dd605 commit f19ed41
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/automerge-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,20 @@ export class AutomergeAction {
}
}

async disableAutoMerge(pullRequest: PullRequest): Promise<DisableAutoMergeMutation> {
async disableAutoMerge(pullRequest: PullRequest): Promise<void> {
if (this.input.dryRun) {
core.info(`Would try disabling auto-merge for pull request ${pullRequest.number}.`)
return
}

try {
core.info(`Disabling auto-merge for pull request ${pullRequest.number}.`)

// We need to get the source code of the query since the `@octokit/graphql`
// API doesn't (yet) support passing a `DocumentNode` object.
const query = DisableAutoMerge.loc!.source!.body

return await this.octokit.graphql({
await this.octokit.graphql({
query,
pullRequestId: pullRequest.node_id,
})
Expand Down

0 comments on commit f19ed41

Please sign in to comment.