refactor(action): reduce redundancy in gitConfig for GitHub, GitLab and BitBucket#581
refactor(action): reduce redundancy in gitConfig for GitHub, GitLab and BitBucket#581giteshsarvaiya wants to merge 1 commit intolingodotdev:mainfrom
Conversation
|
The other PR was merged, however it was updated not to contain the Let's not add a new utils file. Parent |
e40c985 to
a4617e0
Compare
There was a problem hiding this comment.
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
action/src/platforms/bitbucket.ts:96
- Defaulting BITBUCKET_GIT_HTTP_ORIGIN to 'origin' without validating the environment variable may mask potential misconfigurations. Consider adding validation or logging a warning when the variable is not explicitly set to ensure the intended behavior.
const origin = process.env.BITBUCKET_GIT_HTTP_ORIGIN || "origin";
| @@ -91,11 +91,21 @@ export class GitlabPlatformKit extends PlatformKit { | |||
| } | |||
|
|
|||
| gitConfig(): Promise<void> | void { | |||
There was a problem hiding this comment.
The gitConfig function currently has a mixed return type (Promise | void) and relies on console error logging to signal failure. Consider standardizing the return type and error handling approach (for example, by throwing an exception or consistently returning a boolean) across all platform implementations.
| gitConfig(): Promise<void> | void { | |
| async gitConfig(): Promise<void> { |
|
Closing as outdated. Feel free to reopen once the comments are addressed and conflicts resolved. |
Solves Issue: #573
Description:
[Refactor] This PR refactors the
gitConfigimplementation in the./action/srcdirectory for GitHub, GitLab, and Bitbucket, reducing code redundancy.It also introduces error handling using
try-catchblocks for improved reliability.