Skip to content

Commit 6d3272c

Browse files
committed
revert: multi-platform refactoring to align with issue changes requested
1 parent 9c8e243 commit 6d3272c

3 files changed

Lines changed: 10 additions & 22 deletions

File tree

action/src/platforms/git-utils.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

action/src/platforms/github.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Octokit } from "octokit";
22
import { PlatformKit } from "./_base.js";
33
import Z from "zod";
44

5-
import { configureGitCredentials } from "./git-utils.js";
5+
import { execSync } from "child_process";
66

77
export class GitHubPlatformKit extends PlatformKit {
88
private _octokit?: Octokit;
@@ -77,9 +77,11 @@ export class GitHubPlatformKit extends PlatformKit {
7777
if (ghToken && processOwnCommits) {
7878
console.log("Using provided GH_TOKEN. This will trigger your CI/CD pipeline to run again.");
7979

80-
const URL = `https://${ghToken}@github.com/${repositoryOwner}/${repositoryName}.git`;
80+
const url = `https://${ghToken}@github.com/${repositoryOwner}/${repositoryName}.git`;
8181

82-
configureGitCredentials(ghToken, URL);
82+
execSync(`git remote set-url origin ${url}`, {
83+
stdio: "inherit",
84+
});
8385
}
8486
}
8587

action/src/platforms/gitlab.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Gitlab } from "@gitbeaker/rest";
22
import Z from "zod";
33
import { PlatformKit } from "./_base.js";
4-
import { configureGitCredentials } from "./git-utils.js";
4+
import { execSync } from "child_process";
55

66
const gl = new Gitlab({ token: "" });
77

@@ -91,9 +91,11 @@ export class GitlabPlatformKit extends PlatformKit {
9191
}
9292

9393
gitConfig(): Promise<void> | void {
94-
const URL = `https://oauth2:${this.platformConfig.glToken}@gitlab.com/${this.platformConfig.repositoryOwner}/${this.platformConfig.repositoryName}.git`;
94+
const url = `https://oauth2:${this.platformConfig.glToken}@gitlab.com/${this.platformConfig.repositoryOwner}/${this.platformConfig.repositoryName}.git`;
9595

96-
configureGitCredentials(this.platformConfig.glToken, URL);
96+
execSync(`git remote set-url origin ${url}`, {
97+
stdio: "inherit",
98+
});
9799
}
98100

99101
buildPullRequestUrl(pullRequestNumber: number): string {

0 commit comments

Comments
 (0)