Skip to content

Commit 90ffa92

Browse files
committed
Push bugsink envs to frontend app
1 parent c5010f0 commit 90ffa92

File tree

5 files changed

+49
-8
lines changed

5 files changed

+49
-8
lines changed

action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ inputs:
7373
required: false
7474
default: false
7575
type: boolean
76+
bugsink_dsn:
77+
description:
78+
The DSN for the Bugsink service. This is used to send errors to the
79+
Bugsink service.
80+
required: false
81+
default: ''
82+
type: string
7683

7784
# Define your outputs here.
7885
outputs:

dist/index.js

Lines changed: 19 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/coolify.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ export default class Coolify {
3838
private readonly server_uuid?: string
3939
private readonly base_deployment_url: string
4040
private readonly deployment_app_uuid: string
41-
supabase_api_url: string
41+
private readonly supabase_api_url: string
42+
private readonly bugsink_dsn: string
4243

4344
constructor({
4445
baseUrl,
@@ -49,7 +50,8 @@ export default class Coolify {
4950
server_uuid,
5051
supabase_api_url,
5152
base_deployment_url,
52-
deployment_app_uuid
53+
deployment_app_uuid,
54+
bugsink_dsn
5355
}: {
5456
baseUrl: string
5557
token: string
@@ -60,6 +62,7 @@ export default class Coolify {
6062
server_uuid?: string
6163
base_deployment_url: string
6264
deployment_app_uuid: string
65+
bugsink_dsn: string
6366
}) {
6467
this.client = createClient({
6568
baseUrl,
@@ -74,6 +77,7 @@ export default class Coolify {
7477
this.supabase_api_url = supabase_api_url
7578
this.base_deployment_url = base_deployment_url
7679
this.deployment_app_uuid = deployment_app_uuid
80+
this.bugsink_dsn = bugsink_dsn
7781
}
7882
async deployFunctions({
7983
token,
@@ -748,7 +752,15 @@ export default class Coolify {
748752
{ key: 'POSTGRES_PASSWORD', value: postgres_password },
749753
{ key: 'SUPABASE_SERVICE_ROLE_KEY', value: supabase_service_role_key },
750754
{ key: 'NEXT_PUBLIC_SUPABASE_URL', value: supabase_url },
751-
{ key: 'NEXT_PUBLIC_SUPABASE_ANON_KEY', value: supabase_anon_key }
755+
{ key: 'NEXT_PUBLIC_SUPABASE_ANON_KEY', value: supabase_anon_key },
756+
{
757+
key: 'NEXT_PUBLIC_BUGSINK_DSN',
758+
value: this.bugsink_dsn
759+
},
760+
{
761+
key: 'NEXT_PUBLIC_BUGSINK_HOST',
762+
value: extractHostFromDsn(this.bugsink_dsn)
763+
}
752764
])
753765

754766
//Deploy the frontend
@@ -861,3 +873,7 @@ export default class Coolify {
861873
}
862874
}
863875
}
876+
function extractHostFromDsn(bugsink_dsn: string): string {
877+
const url = new URL(bugsink_dsn)
878+
return url.protocol + '//' + url.hostname
879+
}

src/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export async function run() {
1616
const cleanup_service_uuid = getInput('cleanup_service_uuid')
1717
const cleanup_app_uuid = getInput('cleanup_app_uuid')
1818
const reset_supabase_db = getInput('reset_supabase_db')
19+
const bugsink_dsn = getInput('bugsink_dsn')
1920

2021
const coolify = new Coolify({
2122
baseUrl: coolify_api_url,
@@ -26,7 +27,8 @@ export async function run() {
2627
server_uuid: coolify_server_uuid,
2728
supabase_api_url: coolify_supabase_api_url,
2829
base_deployment_url,
29-
deployment_app_uuid
30+
deployment_app_uuid,
31+
bugsink_dsn
3032
})
3133
const branchOrPR = process.env.GITHUB_REF_NAME
3234
const repositoryName = process.env.GITHUB_REPOSITORY

0 commit comments

Comments
 (0)