Skip to content

Commit 4ba4abc

Browse files
committed
feat: allow custom github app slug
1 parent e07e58c commit 4ba4abc

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

app/pages/index.vue

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
<script setup lang="ts">
2+
const config = useRuntimeConfig()
3+
24
const { data: allowedRepos, refresh } = useFetch('/api/repos', {
3-
baseURL: useRuntimeConfig().public.remote,
5+
baseURL: config.public.remote,
46
default: () => [],
57
})
68
9+
const installationURL = `https://github.com/apps/${config.public.github.appSlug}/installations/new`
10+
711
const route = useRoute()
812
const isCallback = ref(!!route.query.installation_id)
913
const numRepos = allowedRepos.value?.length
@@ -31,7 +35,7 @@ const repos = computed(() => allowedRepos.value.filter(r => r.issuesIndexed > 10
3135
</p>
3236
<NuxtLink
3337
class="bg-green-700 rounded-md px-5 py-3 font-medium flex flex-row gap-2 items-center color-white no-underline focus:bg-green-800 hover:bg-green-800 transition-colors shadow-lg"
34-
:href="isCallback ? '' : 'https://github.com/apps/unsight-dev/installations/new'"
38+
:href="isCallback ? '' : installationURL"
3539
:class="{ 'pointer-events-none opacity-50': isCallback }"
3640
>
3741
<template v-if="isCallback">

nuxt.config.ts

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ export default defineNuxtConfig({
2222
runtimeConfig: {
2323
public: {
2424
remote: '/',
25+
github: {
26+
appSlug: 'unsight-dev',
27+
},
2528
},
2629
github: {
2730
appId: '',

0 commit comments

Comments
 (0)