mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
fix: various ui and github sync fixes
This commit is contained in:
@@ -2,7 +2,7 @@ import { Octokit } from "@octokit/rest";
|
||||
import sodium from "libsodium-wrappers";
|
||||
|
||||
import { getGitHubClient } from "@app/services/app-connection/github";
|
||||
import { GitHubSyncScope } from "@app/services/secret-sync/github/github-sync-enums";
|
||||
import { GitHubSyncScope, GitHubSyncVisibility } from "@app/services/secret-sync/github/github-sync-enums";
|
||||
import { SECRET_SYNC_NAME_MAP } from "@app/services/secret-sync/secret-sync-maps";
|
||||
import { TSecretMap } from "@app/services/secret-sync/secret-sync-types";
|
||||
|
||||
@@ -149,7 +149,9 @@ const putSecret = async (client: Octokit, secretSync: TGitHubSyncWithCredentials
|
||||
org: destinationConfig.org,
|
||||
...payload,
|
||||
visibility,
|
||||
selected_repository_ids: selectedRepositoryIds
|
||||
...(visibility === GitHubSyncVisibility.Selected && {
|
||||
selected_repository_ids: selectedRepositoryIds
|
||||
})
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -34,10 +34,20 @@ const GitHubSyncDestinationConfigSchema = z
|
||||
.superRefine((options, ctx) => {
|
||||
if (options.scope !== GitHubSyncScope.Organization) return;
|
||||
|
||||
if (options.visibility === GitHubSyncVisibility.Selected && !options.selectedRepositoryIds?.length) {
|
||||
if (options.visibility === GitHubSyncVisibility.Selected) {
|
||||
if (!options.selectedRepositoryIds?.length)
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: "Select at least 1 repository",
|
||||
path: ["selectedRepositoryIds"]
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (options.selectedRepositoryIds?.length) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: "Select at least 1 repository",
|
||||
message: `Selected repositories is only supported for visibility "Selected"`,
|
||||
path: ["selectedRepositoryIds"]
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user