Skip to content

Commit f94322a

Browse files
authored
GHE support (#1)
* made DEFAULT_ACTIONS_RESULTS_URL configurable
1 parent 23c4548 commit f94322a

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ services:
1717
- '3000:3000'
1818
environment:
1919
API_BASE_URL: http://localhost:3000
20+
DEFAULT_ACTIONS_RESULTS_URL: https://results-receiver.actions.githubusercontent.com
2021
STORAGE_DRIVER: filesystem
2122
STORAGE_FILESYSTEM_PATH: /data/cache
2223
DB_DRIVER: sqlite

lib/schemas.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ export const envDbDriverSchema = type.or(
5757

5858
export const envBaseSchema = type({
5959
'API_BASE_URL': 'string.url',
60+
'DEFAULT_ACTIONS_RESULTS_URL':
61+
"string.url = 'https://results-receiver.actions.githubusercontent.com'",
6062
'CACHE_CLEANUP_OLDER_THAN_DAYS': 'number = 90',
6163
'DISABLE_CLEANUP_JOBS?': 'boolean',
6264
'DEBUG?': 'boolean',

routes/[...path].ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
import { env } from '~/lib/env'
12
import { logger } from '~/lib/logger'
23

3-
const DEFAULT_ACTIONS_RESULTS_URL = 'https://results-receiver.actions.githubusercontent.com'
4-
54
export default defineEventHandler(async (event) => {
6-
logger.debug('proxying unknown path', event.path, 'to', DEFAULT_ACTIONS_RESULTS_URL)
7-
return proxyRequest(event, `${DEFAULT_ACTIONS_RESULTS_URL}${event.path}`)
5+
logger.debug('proxying unknown path', event.path, 'to', env.DEFAULT_ACTIONS_RESULTS_URL)
6+
return proxyRequest(event, `${env.DEFAULT_ACTIONS_RESULTS_URL}${event.path}`)
87
})

tests/setup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const env = createEnv({
2626

2727
const TESTING_ENV_BASE = {
2828
API_BASE_URL: 'http://localhost:3000',
29+
DEFAULT_ACTIONS_RESULTS_URL: 'https://results-receiver.actions.xxxxxx.ghe.com',
2930
RUNNER_TEMP: path.join(TEST_TEMP_DIR, 'runner-temp'),
3031
ACTIONS_RESULTS_URL: 'http://localhost:3000/',
3132
ACTIONS_CACHE_URL: 'http://localhost:3000/',

0 commit comments

Comments
 (0)