Skip to content

Commit

Permalink
gh-env-secrets: update type
Browse files Browse the repository at this point in the history
  • Loading branch information
Shraeyas committed Dec 2, 2023
1 parent 4e303b2 commit 549a549
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/src/integrations/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ const getAppsGithub = async ({ accessToken, workspaceSlug }: { accessToken: stri
auth: accessToken
});

if(workspaceSlug) {
if(workspaceSlug && workspaceSlug !== "none") {
// get github environments if workflowSlug is set
const { data } = await octokit.request("GET /user", {
headers: {
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/pages/integrations/github/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default function GitHubCreateIntegrationPage() {
const { data: integrationAuth } = useGetIntegrationAuthById((integrationAuthId as string) ?? "");
const { data: targetRepositories } = useGetIntegrationAuthGitHubRepositories((integrationAuthId as string) ?? "");

const [workspaceSlug, setWorkspaceSlug] = useState();
const [workspaceSlug, setWorkspaceSlug] = useState("none");
const { data: integrationAuthApps, isLoading: isIntegrationAuthAppsLoading } = useGetIntegrationAuthApps({
integrationAuthId: (integrationAuthId as string) ?? "",
workspaceSlug
Expand Down Expand Up @@ -113,7 +113,7 @@ export default function GitHubCreateIntegrationPage() {

useEffect(() => {
if(githubIntegration === "github-repo-secrets") {
setWorkspaceSlug(null)
setWorkspaceSlug("none")
} else {
setWorkspaceSlug(targetRepositories?.find(repo => repo.id === targetRepositoryId)?.name ?? "none")
}
Expand All @@ -129,7 +129,7 @@ export default function GitHubCreateIntegrationPage() {
(integrationAuthApp) => targetAppIds.includes(String(integrationAuthApp.appId))
);

if(githubIntegration === "github-repo-secrets") {
if(githubIntegration === "github-repo-secrets" && targetApps) {
await Promise.all(
targetApps.map(async (targetApp) => {
await mutateAsync({
Expand Down

0 comments on commit 549a549

Please sign in to comment.