From 51e2904f2f65b68688063e8cdb8affac5ee8d346 Mon Sep 17 00:00:00 2001 From: Enda Date: Tue, 8 Feb 2022 16:25:48 +0000 Subject: [PATCH] feat: add option to provide custom templates (#3) --- action.yml | 3 +++ src/main.ts | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/action.yml b/action.yml index f9cdc66..aef2a70 100644 --- a/action.yml +++ b/action.yml @@ -32,6 +32,9 @@ inputs: additional-properties: description: 'Provide a config object of additional properties' required: false + template: + description: Directory of the templates used to generate code + required: false ignore-file-override: description: 'Pass a custom OpenAPI Generator ignore file' required: false diff --git a/src/main.ts b/src/main.ts index 987cfbc..d2cd89c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -34,6 +34,10 @@ async function run(): Promise { if (ignoreFileOverride) { generateArgs.push('--ignore-file-override', ignoreFileOverride); } + const templatesDir = core.getInput('template'); + if (templatesDir) { + generateArgs.push('--template'); + } const config = core.getInput('config'); if (config) { generateArgs.push('--config', config);