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 88 config :
99 required : true
1010 description : ' Path to the config'
11+ workspace :
12+ required : false
13+ description : ' Path to the root of the workspace'
1114runs :
1215 using : ' node12'
1316 main : ' dist/index.js'
Original file line number Diff line number Diff line change 11import { Schema , Validator } from 'jsonschema' ;
22import * as path from 'path' ;
33
4+ import * as core from '@actions/core' ;
5+
46import { PROJECT_ROOT } from './constants' ;
57
68import { IConfig } from './interfaces/IConfig' ;
79
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+
819export 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 ) ;
1022
1123 return configs ;
1224} ;
Original file line number Diff line number Diff line change 11import * as core from '@actions/core' ;
2- import { Validator } from 'jsonschema' ;
32
43// add .env file support for dev purposes
54require ( 'dotenv' ) . config ( ) ;
65
76import { AuthorizationError } from './errors/AuthorizationError' ;
87import { ProjectsOctoKit } from './octokit/ProjectsOctoKit' ;
98import { renderProject } from './views/renderProject' ;
10- import { renderOverview } from './views/renderOverview' ;
119import { getProjectData } from './utils/getProjectData' ;
1210import { env } from './utils/env' ;
1311import { getConfigs , validateConfig } from './config' ;
You can’t perform that action at this time.
0 commit comments