From 5a293e4b432ff9d1d65ddb7c214a1ea912dba388 Mon Sep 17 00:00:00 2001 From: Koen Van Looveren Date: Mon, 27 Nov 2023 19:00:12 +0100 Subject: [PATCH] feat: Added script-pre-run --- action.yml | 3 +++ index.js | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/action.yml b/action.yml index fa7d57e..b26fa47 100644 --- a/action.yml +++ b/action.yml @@ -11,3 +11,6 @@ inputs: description: 'Prefix that is used for the git tag' default: 'v' required: false + script-pre-run: + description: 'Path to a dart script that is executed before the version bump' + required: false diff --git a/index.js b/index.js index 63b5774..c151308 100644 --- a/index.js +++ b/index.js @@ -69,8 +69,21 @@ async function uploadDartProject() { await runInWorkspace('dart', ['pub', 'publish']) } + +async function executeScriptPreRun() { + const path = core.getInput('script-pre-run') + if (!path) { + return + } + await runInWorkspace('dart', ['run', path]) +} + async function run() { try { + // Run a script before the action (only if configured) + await executeScriptPreRun() + + // Configure pub.dev token from github await configurePubDevToken() const pubspec = getPubspec()