mirror of
https://github.com/kiegroup/git-backporting.git
synced 2025-04-24 20:32:14 +00:00
minors
This commit is contained in:
parent
74703c48f3
commit
8828684a38
6 changed files with 13 additions and 14 deletions
9
.github/workflows/release.yml
vendored
9
.github/workflows/release.yml
vendored
|
@ -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}}
|
||||
|
||||
|
|
|
@ -40,8 +40,8 @@ class GitCLIService {
|
|||
* Return the git version
|
||||
* @returns {Promise<string | undefined>}
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
|
4
dist/cli/index.js
vendored
4
dist/cli/index.js
vendored
|
@ -198,8 +198,8 @@ class GitCLIService {
|
|||
* Return the git version
|
||||
* @returns {Promise<string | undefined>}
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
|
4
dist/gha/index.js
vendored
4
dist/gha/index.js
vendored
|
@ -177,8 +177,8 @@ class GitCLIService {
|
|||
* Return the git version
|
||||
* @returns {Promise<string | undefined>}
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -46,8 +46,8 @@ export default class GitCLIService {
|
|||
* Return the git version
|
||||
* @returns {Promise<string | undefined>}
|
||||
*/
|
||||
async version(): Promise<string | undefined> {
|
||||
const rawOutput = await this.git().raw("version");
|
||||
async version(cwd: string): Promise<string | undefined> {
|
||||
const rawOutput = await this.git(cwd).raw("version");
|
||||
const match = rawOutput.match(/(\d+\.\d+(\.\d+)?)/);
|
||||
return match ? match[1] : undefined;
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue