From 966efc31a340e9e20cd867b2b6e75666dd6eb9d1 Mon Sep 17 00:00:00 2001 From: phips28 Date: Sat, 4 Apr 2020 01:39:59 +0200 Subject: [PATCH] support v1 --- index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.js b/index.js index 78d2d28..2a5b43c 100644 --- a/index.js +++ b/index.js @@ -54,6 +54,13 @@ Toolkit.run(async tools => { newVersion = execSync(`npm version --git-tag-version=false ${version}`).toString().trim() newVersion = `${process.env['INPUT_TAG-PREFIX']}${newVersion}` console.log('new version:', newVersion) + try { + // to support "actions/checkout@v1" + await tools.runInWorkspace('git', ['commit', '-a', '-m', `ci: ${commitMessage} ${newVersion}`]) + } catch (e) { + console.warn('git commit failed because you are using "actions/checkout@v2"; ' + + 'but that doesnt matter because you dont need that git commit, thats only for "actions/checkout@v1"') + } const remoteRepo = `https://${process.env.GITHUB_ACTOR}:${process.env.GITHUB_TOKEN}@github.com/${process.env.GITHUB_REPOSITORY}.git` // console.log(Buffer.from(remoteRepo).toString('base64'))