From e96b00a7224e718fef59465e2e3e49fcf7bda295 Mon Sep 17 00:00:00 2001 From: Peter Benjamin Date: Mon, 15 Jan 2024 15:18:31 -0800 Subject: [PATCH] feat: support template urls Closes #72 --- action.yml | 2 +- src/index.js | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 1076e26..94d4d14 100644 --- a/action.yml +++ b/action.yml @@ -14,7 +14,7 @@ inputs: required: false templates: - description: "Templates input file/files to check across hosts" + description: "Templates input file(s)/URL to check across hosts" required: false workflows: diff --git a/src/index.js b/src/index.js index e1e1e5c..f4fcb26 100644 --- a/src/index.js +++ b/src/index.js @@ -52,7 +52,15 @@ async function run() { // Setting up params if (target) params.push(`-target=${target}`); if (urls) params.push(`-list=${urls}`); - if (templates) params.push(`-t=${templates}`); + if (templates) { + try { + new URL(templates) + params.push(`-turl=${templates}`); + } + catch(_) { + params.push(`-t=${templates}`); + } + } if (workflows) params.push(`-w=${workflows}`); params.push(`-se=${sarifExport ? sarifExport : 'nuclei.sarif'}`); if (markdownExport) params.push(`-me=${markdownExport}`);