From 8828684a38d5ff765a62a1e8ebaaed1b3a4074f5 Mon Sep 17 00:00:00 2001 From: Andrea Lamparelli Date: Fri, 23 Dec 2022 19:38:57 +0100 Subject: [PATCH] minors --- .github/workflows/release.yml | 9 ++++----- build/src/service/git/git-cli.js | 4 ++-- dist/cli/index.js | 4 ++-- dist/gha/index.js | 4 ++-- src/service/git/git-cli.ts | 4 ++-- test/service/git/git-cli.test.ts | 2 +- 6 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c9c1127..4e07716 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,9 +11,9 @@ on: default: patch type: string message: - description: 'version commit message to be used' + description: 'bump version commit message' required: false - default: 'Bumping version %s' + default: 'Bump release version %s' type: string jobs: @@ -26,9 +26,8 @@ jobs: with: node-version: 16 registry-url: https://registry.npmjs.org/ - - run: npm version $(semver $npm_package_version -i ${{ inputs.version }}) -m "${{ inputs.message }}" - - run: npm install - - run: npm publish --access public + - run: npm version ${{ inputs.version }} -m "${{ inputs.message }}" + - run: npm install && npm publish --access public env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/build/src/service/git/git-cli.js b/build/src/service/git/git-cli.js index d9fa5f2..ebf7eeb 100644 --- a/build/src/service/git/git-cli.js +++ b/build/src/service/git/git-cli.js @@ -40,8 +40,8 @@ class GitCLIService { * Return the git version * @returns {Promise} */ - async version() { - const rawOutput = await this.git().raw("version"); + async version(cwd) { + const rawOutput = await this.git(cwd).raw("version"); const match = rawOutput.match(/(\d+\.\d+(\.\d+)?)/); return match ? match[1] : undefined; } diff --git a/dist/cli/index.js b/dist/cli/index.js index 4960187..1f0e2aa 100755 --- a/dist/cli/index.js +++ b/dist/cli/index.js @@ -198,8 +198,8 @@ class GitCLIService { * Return the git version * @returns {Promise} */ - async version() { - const rawOutput = await this.git().raw("version"); + async version(cwd) { + const rawOutput = await this.git(cwd).raw("version"); const match = rawOutput.match(/(\d+\.\d+(\.\d+)?)/); return match ? match[1] : undefined; } diff --git a/dist/gha/index.js b/dist/gha/index.js index 7ce2ac6..1f8992e 100755 --- a/dist/gha/index.js +++ b/dist/gha/index.js @@ -177,8 +177,8 @@ class GitCLIService { * Return the git version * @returns {Promise} */ - async version() { - const rawOutput = await this.git().raw("version"); + async version(cwd) { + const rawOutput = await this.git(cwd).raw("version"); const match = rawOutput.match(/(\d+\.\d+(\.\d+)?)/); return match ? match[1] : undefined; } diff --git a/src/service/git/git-cli.ts b/src/service/git/git-cli.ts index 3a5c5e8..1df5a31 100644 --- a/src/service/git/git-cli.ts +++ b/src/service/git/git-cli.ts @@ -46,8 +46,8 @@ export default class GitCLIService { * Return the git version * @returns {Promise} */ - async version(): Promise { - const rawOutput = await this.git().raw("version"); + async version(cwd: string): Promise { + const rawOutput = await this.git(cwd).raw("version"); const match = rawOutput.match(/(\d+\.\d+(\.\d+)?)/); return match ? match[1] : undefined; } diff --git a/test/service/git/git-cli.test.ts b/test/service/git/git-cli.test.ts index 28f7b97..746d847 100644 --- a/test/service/git/git-cli.test.ts +++ b/test/service/git/git-cli.test.ts @@ -74,7 +74,7 @@ beforeEach(() => { describe("git cli service", () => { test("version", async () => { - const result = await git.version(); + const result = await git.version(cwd); const actualVersion = spawnSync("git", ["version"]).stdout.toString(); const match = actualVersion.match(/(\d+\.\d+(\.\d+)?)/); if (match) {