Skip to content

Commit

Permalink
feat: Added script-pre-run
Browse files Browse the repository at this point in the history
  • Loading branch information
vanlooverenkoen committed Nov 27, 2023
1 parent 1041a06 commit 5a293e4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 13 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 5a293e4

Please sign in to comment.