@postman-cse/onboarding-repo-sync 2.6.6 → 2.6.8
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.
- package/dist/action.cjs +54 -12
- package/dist/cli.cjs +54 -12
- package/dist/index.cjs +54 -12
- package/package.json +1 -1
package/dist/action.cjs
CHANGED
|
@@ -114484,7 +114484,7 @@ var RepoMutationService = class {
|
|
|
114484
114484
|
"-m",
|
|
114485
114485
|
"chore: sync Postman artifacts and metadata"
|
|
114486
114486
|
]);
|
|
114487
|
-
|
|
114487
|
+
let commitSha = (await this.execute("git", ["rev-parse", "HEAD"])).stdout.trim();
|
|
114488
114488
|
if (options.repoWriteMode !== "commit-and-push") {
|
|
114489
114489
|
return {
|
|
114490
114490
|
commitSha,
|
|
@@ -114496,6 +114496,7 @@ var RepoMutationService = class {
|
|
|
114496
114496
|
let pushed = false;
|
|
114497
114497
|
let lastError = "";
|
|
114498
114498
|
let remoteChanged = false;
|
|
114499
|
+
let stopCandidates = false;
|
|
114499
114500
|
const isNonRetryablePushError = (message) => /workflow|permission/i.test(message);
|
|
114500
114501
|
try {
|
|
114501
114502
|
const pushCandidates = usePersistedCredentials ? [null] : tokens;
|
|
@@ -114515,18 +114516,59 @@ var RepoMutationService = class {
|
|
|
114515
114516
|
]);
|
|
114516
114517
|
remoteChanged = true;
|
|
114517
114518
|
}
|
|
114518
|
-
|
|
114519
|
-
|
|
114520
|
-
|
|
114521
|
-
|
|
114522
|
-
|
|
114523
|
-
|
|
114524
|
-
|
|
114525
|
-
|
|
114526
|
-
|
|
114519
|
+
for (let pushAttempt = 0; pushAttempt < 2; pushAttempt += 1) {
|
|
114520
|
+
const fetch2 = await this.execute("git", [
|
|
114521
|
+
...resetConfigArgs,
|
|
114522
|
+
"fetch",
|
|
114523
|
+
"--no-tags",
|
|
114524
|
+
"origin",
|
|
114525
|
+
`refs/heads/${resolvedCurrentRef}`
|
|
114526
|
+
]);
|
|
114527
|
+
const fetchError = fetch2.stderr || fetch2.stdout || "";
|
|
114528
|
+
const targetBranchDoesNotExist = /couldn't find remote ref|remote ref .* not found/i.test(
|
|
114529
|
+
fetchError
|
|
114530
|
+
);
|
|
114531
|
+
if (fetch2.exitCode !== 0 && !targetBranchDoesNotExist) {
|
|
114532
|
+
lastError = fetchError;
|
|
114533
|
+
stopCandidates = isNonRetryablePushError(lastError);
|
|
114534
|
+
break;
|
|
114535
|
+
}
|
|
114536
|
+
if (fetch2.exitCode === 0) {
|
|
114537
|
+
const rebase = await this.execute("git", [
|
|
114538
|
+
"rebase",
|
|
114539
|
+
"-X",
|
|
114540
|
+
"theirs",
|
|
114541
|
+
"FETCH_HEAD"
|
|
114542
|
+
]);
|
|
114543
|
+
if (rebase.exitCode !== 0) {
|
|
114544
|
+
await this.execute("git", ["rebase", "--abort"]);
|
|
114545
|
+
const cause = rebase.stderr || rebase.stdout || "Failed to rebase generated changes";
|
|
114546
|
+
throw new Error(
|
|
114547
|
+
secretMasker(
|
|
114548
|
+
`REPO_PUSH_RECONCILE_FAILED: Could not rebase generated changes onto ${resolvedCurrentRef}: ${cause}`
|
|
114549
|
+
)
|
|
114550
|
+
);
|
|
114551
|
+
}
|
|
114552
|
+
commitSha = (await this.execute("git", ["rev-parse", "HEAD"])).stdout.trim();
|
|
114553
|
+
}
|
|
114554
|
+
const push = await this.execute("git", [
|
|
114555
|
+
...resetConfigArgs,
|
|
114556
|
+
"push",
|
|
114557
|
+
"origin",
|
|
114558
|
+
`HEAD:refs/heads/${resolvedCurrentRef}`
|
|
114559
|
+
]);
|
|
114560
|
+
if (push.exitCode === 0) {
|
|
114561
|
+
pushed = true;
|
|
114562
|
+
break;
|
|
114563
|
+
}
|
|
114564
|
+
lastError = push.stderr || push.stdout || "";
|
|
114565
|
+
stopCandidates = isNonRetryablePushError(lastError);
|
|
114566
|
+
const targetAdvanced = /non-fast-forward|fetch first|remote contains work/i.test(lastError);
|
|
114567
|
+
if (stopCandidates || !targetAdvanced) {
|
|
114568
|
+
break;
|
|
114569
|
+
}
|
|
114527
114570
|
}
|
|
114528
|
-
|
|
114529
|
-
if (isNonRetryablePushError(lastError)) {
|
|
114571
|
+
if (pushed || stopCandidates) {
|
|
114530
114572
|
break;
|
|
114531
114573
|
}
|
|
114532
114574
|
}
|
package/dist/cli.cjs
CHANGED
|
@@ -112589,7 +112589,7 @@ var RepoMutationService = class {
|
|
|
112589
112589
|
"-m",
|
|
112590
112590
|
"chore: sync Postman artifacts and metadata"
|
|
112591
112591
|
]);
|
|
112592
|
-
|
|
112592
|
+
let commitSha = (await this.execute("git", ["rev-parse", "HEAD"])).stdout.trim();
|
|
112593
112593
|
if (options.repoWriteMode !== "commit-and-push") {
|
|
112594
112594
|
return {
|
|
112595
112595
|
commitSha,
|
|
@@ -112601,6 +112601,7 @@ var RepoMutationService = class {
|
|
|
112601
112601
|
let pushed = false;
|
|
112602
112602
|
let lastError = "";
|
|
112603
112603
|
let remoteChanged = false;
|
|
112604
|
+
let stopCandidates = false;
|
|
112604
112605
|
const isNonRetryablePushError = (message) => /workflow|permission/i.test(message);
|
|
112605
112606
|
try {
|
|
112606
112607
|
const pushCandidates = usePersistedCredentials ? [null] : tokens;
|
|
@@ -112620,18 +112621,59 @@ var RepoMutationService = class {
|
|
|
112620
112621
|
]);
|
|
112621
112622
|
remoteChanged = true;
|
|
112622
112623
|
}
|
|
112623
|
-
|
|
112624
|
-
|
|
112625
|
-
|
|
112626
|
-
|
|
112627
|
-
|
|
112628
|
-
|
|
112629
|
-
|
|
112630
|
-
|
|
112631
|
-
|
|
112624
|
+
for (let pushAttempt = 0; pushAttempt < 2; pushAttempt += 1) {
|
|
112625
|
+
const fetch2 = await this.execute("git", [
|
|
112626
|
+
...resetConfigArgs,
|
|
112627
|
+
"fetch",
|
|
112628
|
+
"--no-tags",
|
|
112629
|
+
"origin",
|
|
112630
|
+
`refs/heads/${resolvedCurrentRef}`
|
|
112631
|
+
]);
|
|
112632
|
+
const fetchError = fetch2.stderr || fetch2.stdout || "";
|
|
112633
|
+
const targetBranchDoesNotExist = /couldn't find remote ref|remote ref .* not found/i.test(
|
|
112634
|
+
fetchError
|
|
112635
|
+
);
|
|
112636
|
+
if (fetch2.exitCode !== 0 && !targetBranchDoesNotExist) {
|
|
112637
|
+
lastError = fetchError;
|
|
112638
|
+
stopCandidates = isNonRetryablePushError(lastError);
|
|
112639
|
+
break;
|
|
112640
|
+
}
|
|
112641
|
+
if (fetch2.exitCode === 0) {
|
|
112642
|
+
const rebase = await this.execute("git", [
|
|
112643
|
+
"rebase",
|
|
112644
|
+
"-X",
|
|
112645
|
+
"theirs",
|
|
112646
|
+
"FETCH_HEAD"
|
|
112647
|
+
]);
|
|
112648
|
+
if (rebase.exitCode !== 0) {
|
|
112649
|
+
await this.execute("git", ["rebase", "--abort"]);
|
|
112650
|
+
const cause = rebase.stderr || rebase.stdout || "Failed to rebase generated changes";
|
|
112651
|
+
throw new Error(
|
|
112652
|
+
secretMasker(
|
|
112653
|
+
`REPO_PUSH_RECONCILE_FAILED: Could not rebase generated changes onto ${resolvedCurrentRef}: ${cause}`
|
|
112654
|
+
)
|
|
112655
|
+
);
|
|
112656
|
+
}
|
|
112657
|
+
commitSha = (await this.execute("git", ["rev-parse", "HEAD"])).stdout.trim();
|
|
112658
|
+
}
|
|
112659
|
+
const push = await this.execute("git", [
|
|
112660
|
+
...resetConfigArgs,
|
|
112661
|
+
"push",
|
|
112662
|
+
"origin",
|
|
112663
|
+
`HEAD:refs/heads/${resolvedCurrentRef}`
|
|
112664
|
+
]);
|
|
112665
|
+
if (push.exitCode === 0) {
|
|
112666
|
+
pushed = true;
|
|
112667
|
+
break;
|
|
112668
|
+
}
|
|
112669
|
+
lastError = push.stderr || push.stdout || "";
|
|
112670
|
+
stopCandidates = isNonRetryablePushError(lastError);
|
|
112671
|
+
const targetAdvanced = /non-fast-forward|fetch first|remote contains work/i.test(lastError);
|
|
112672
|
+
if (stopCandidates || !targetAdvanced) {
|
|
112673
|
+
break;
|
|
112674
|
+
}
|
|
112632
112675
|
}
|
|
112633
|
-
|
|
112634
|
-
if (isNonRetryablePushError(lastError)) {
|
|
112676
|
+
if (pushed || stopCandidates) {
|
|
112635
112677
|
break;
|
|
112636
112678
|
}
|
|
112637
112679
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -114507,7 +114507,7 @@ var RepoMutationService = class {
|
|
|
114507
114507
|
"-m",
|
|
114508
114508
|
"chore: sync Postman artifacts and metadata"
|
|
114509
114509
|
]);
|
|
114510
|
-
|
|
114510
|
+
let commitSha = (await this.execute("git", ["rev-parse", "HEAD"])).stdout.trim();
|
|
114511
114511
|
if (options.repoWriteMode !== "commit-and-push") {
|
|
114512
114512
|
return {
|
|
114513
114513
|
commitSha,
|
|
@@ -114519,6 +114519,7 @@ var RepoMutationService = class {
|
|
|
114519
114519
|
let pushed = false;
|
|
114520
114520
|
let lastError = "";
|
|
114521
114521
|
let remoteChanged = false;
|
|
114522
|
+
let stopCandidates = false;
|
|
114522
114523
|
const isNonRetryablePushError = (message) => /workflow|permission/i.test(message);
|
|
114523
114524
|
try {
|
|
114524
114525
|
const pushCandidates = usePersistedCredentials ? [null] : tokens;
|
|
@@ -114538,18 +114539,59 @@ var RepoMutationService = class {
|
|
|
114538
114539
|
]);
|
|
114539
114540
|
remoteChanged = true;
|
|
114540
114541
|
}
|
|
114541
|
-
|
|
114542
|
-
|
|
114543
|
-
|
|
114544
|
-
|
|
114545
|
-
|
|
114546
|
-
|
|
114547
|
-
|
|
114548
|
-
|
|
114549
|
-
|
|
114542
|
+
for (let pushAttempt = 0; pushAttempt < 2; pushAttempt += 1) {
|
|
114543
|
+
const fetch2 = await this.execute("git", [
|
|
114544
|
+
...resetConfigArgs,
|
|
114545
|
+
"fetch",
|
|
114546
|
+
"--no-tags",
|
|
114547
|
+
"origin",
|
|
114548
|
+
`refs/heads/${resolvedCurrentRef}`
|
|
114549
|
+
]);
|
|
114550
|
+
const fetchError = fetch2.stderr || fetch2.stdout || "";
|
|
114551
|
+
const targetBranchDoesNotExist = /couldn't find remote ref|remote ref .* not found/i.test(
|
|
114552
|
+
fetchError
|
|
114553
|
+
);
|
|
114554
|
+
if (fetch2.exitCode !== 0 && !targetBranchDoesNotExist) {
|
|
114555
|
+
lastError = fetchError;
|
|
114556
|
+
stopCandidates = isNonRetryablePushError(lastError);
|
|
114557
|
+
break;
|
|
114558
|
+
}
|
|
114559
|
+
if (fetch2.exitCode === 0) {
|
|
114560
|
+
const rebase = await this.execute("git", [
|
|
114561
|
+
"rebase",
|
|
114562
|
+
"-X",
|
|
114563
|
+
"theirs",
|
|
114564
|
+
"FETCH_HEAD"
|
|
114565
|
+
]);
|
|
114566
|
+
if (rebase.exitCode !== 0) {
|
|
114567
|
+
await this.execute("git", ["rebase", "--abort"]);
|
|
114568
|
+
const cause = rebase.stderr || rebase.stdout || "Failed to rebase generated changes";
|
|
114569
|
+
throw new Error(
|
|
114570
|
+
secretMasker(
|
|
114571
|
+
`REPO_PUSH_RECONCILE_FAILED: Could not rebase generated changes onto ${resolvedCurrentRef}: ${cause}`
|
|
114572
|
+
)
|
|
114573
|
+
);
|
|
114574
|
+
}
|
|
114575
|
+
commitSha = (await this.execute("git", ["rev-parse", "HEAD"])).stdout.trim();
|
|
114576
|
+
}
|
|
114577
|
+
const push = await this.execute("git", [
|
|
114578
|
+
...resetConfigArgs,
|
|
114579
|
+
"push",
|
|
114580
|
+
"origin",
|
|
114581
|
+
`HEAD:refs/heads/${resolvedCurrentRef}`
|
|
114582
|
+
]);
|
|
114583
|
+
if (push.exitCode === 0) {
|
|
114584
|
+
pushed = true;
|
|
114585
|
+
break;
|
|
114586
|
+
}
|
|
114587
|
+
lastError = push.stderr || push.stdout || "";
|
|
114588
|
+
stopCandidates = isNonRetryablePushError(lastError);
|
|
114589
|
+
const targetAdvanced = /non-fast-forward|fetch first|remote contains work/i.test(lastError);
|
|
114590
|
+
if (stopCandidates || !targetAdvanced) {
|
|
114591
|
+
break;
|
|
114592
|
+
}
|
|
114550
114593
|
}
|
|
114551
|
-
|
|
114552
|
-
if (isNonRetryablePushError(lastError)) {
|
|
114594
|
+
if (pushed || stopCandidates) {
|
|
114553
114595
|
break;
|
|
114554
114596
|
}
|
|
114555
114597
|
}
|