@ravshansbox/pi-next-issue 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/github.ts +4 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ravshansbox/pi-next-issue",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Pi extension that works through GitHub issues in the background",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/github.ts CHANGED
@@ -248,6 +248,10 @@ export async function merge(
248
248
  timeoutMs: number,
249
249
  signal: AbortSignal,
250
250
  ): Promise<boolean> {
251
+ const before = await gh(repo, ['pr', 'view', String(pr), '--json', 'state', '--jq', '.state']);
252
+ if (before === 'MERGED') {
253
+ return true;
254
+ }
251
255
  const result = await run('gh', ['pr', 'merge', String(pr), '--squash', '--repo', repo.slug], {
252
256
  cwd: repo.root,
253
257
  });