File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 8
8
config :
9
9
required : true
10
10
description : ' Path to the config'
11
+ workspace :
12
+ required : false
13
+ description : ' Path to the root of the workspace'
11
14
runs :
12
15
using : ' node12'
13
16
main : ' dist/index.js'
Original file line number Diff line number Diff line change 1
1
import { Schema , Validator } from 'jsonschema' ;
2
2
import * as path from 'path' ;
3
3
4
+ import * as core from '@actions/core' ;
5
+
4
6
import { PROJECT_ROOT } from './constants' ;
5
7
6
8
import { IConfig } from './interfaces/IConfig' ;
7
9
10
+ const getWorkspacePath = ( configFilePath : string ) => {
11
+ const rootPath = core . getInput ( 'workspace' ) ;
12
+ if ( ! rootPath ) {
13
+ return ;
14
+ }
15
+
16
+ return path . join ( rootPath , configFilePath ) ;
17
+ }
18
+
8
19
export const getConfigs = ( configFilePath : string ) : IConfig [ ] => {
9
- const configs = require ( path . join ( PROJECT_ROOT , configFilePath ) ) ;
20
+ const rootPath = getWorkspacePath ( configFilePath ) ?? path . join ( PROJECT_ROOT , configFilePath ) ;
21
+ const configs = require ( rootPath ) ;
10
22
11
23
return configs ;
12
24
} ;
Original file line number Diff line number Diff line change 1
1
import * as core from '@actions/core' ;
2
- import { Validator } from 'jsonschema' ;
3
2
4
3
// add .env file support for dev purposes
5
4
require ( 'dotenv' ) . config ( ) ;
6
5
7
6
import { AuthorizationError } from './errors/AuthorizationError' ;
8
7
import { ProjectsOctoKit } from './octokit/ProjectsOctoKit' ;
9
8
import { renderProject } from './views/renderProject' ;
10
- import { renderOverview } from './views/renderOverview' ;
11
9
import { getProjectData } from './utils/getProjectData' ;
12
10
import { env } from './utils/env' ;
13
11
import { getConfigs , validateConfig } from './config' ;
You can’t perform that action at this time.
0 commit comments