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
|
default: patch
|
||||||
type: string
|
type: string
|
||||||
message:
|
message:
|
||||||
description: 'version commit message to be used'
|
description: 'bump version commit message'
|
||||||
required: false
|
required: false
|
||||||
default: 'Bumping version %s'
|
default: 'Bump release version %s'
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
@ -26,9 +26,8 @@ jobs:
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
registry-url: https://registry.npmjs.org/
|
registry-url: https://registry.npmjs.org/
|
||||||
- run: npm version $(semver $npm_package_version -i ${{ inputs.version }}) -m "${{ inputs.message }}"
|
- run: npm version ${{ inputs.version }} -m "${{ inputs.message }}"
|
||||||
- run: npm install
|
- run: npm install && npm publish --access public
|
||||||
- run: npm publish --access public
|
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,8 @@ class GitCLIService {
|
||||||
* Return the git version
|
* Return the git version
|
||||||
* @returns {Promise<string | undefined>}
|
* @returns {Promise<string | undefined>}
|
||||||
*/
|
*/
|
||||||
async version() {
|
async version(cwd) {
|
||||||
const rawOutput = await this.git().raw("version");
|
const rawOutput = await this.git(cwd).raw("version");
|
||||||
const match = rawOutput.match(/(\d+\.\d+(\.\d+)?)/);
|
const match = rawOutput.match(/(\d+\.\d+(\.\d+)?)/);
|
||||||
return match ? match[1] : undefined;
|
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
|
* Return the git version
|
||||||
* @returns {Promise<string | undefined>}
|
* @returns {Promise<string | undefined>}
|
||||||
*/
|
*/
|
||||||
async version() {
|
async version(cwd) {
|
||||||
const rawOutput = await this.git().raw("version");
|
const rawOutput = await this.git(cwd).raw("version");
|
||||||
const match = rawOutput.match(/(\d+\.\d+(\.\d+)?)/);
|
const match = rawOutput.match(/(\d+\.\d+(\.\d+)?)/);
|
||||||
return match ? match[1] : undefined;
|
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
|
* Return the git version
|
||||||
* @returns {Promise<string | undefined>}
|
* @returns {Promise<string | undefined>}
|
||||||
*/
|
*/
|
||||||
async version() {
|
async version(cwd) {
|
||||||
const rawOutput = await this.git().raw("version");
|
const rawOutput = await this.git(cwd).raw("version");
|
||||||
const match = rawOutput.match(/(\d+\.\d+(\.\d+)?)/);
|
const match = rawOutput.match(/(\d+\.\d+(\.\d+)?)/);
|
||||||
return match ? match[1] : undefined;
|
return match ? match[1] : undefined;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,8 +46,8 @@ export default class GitCLIService {
|
||||||
* Return the git version
|
* Return the git version
|
||||||
* @returns {Promise<string | undefined>}
|
* @returns {Promise<string | undefined>}
|
||||||
*/
|
*/
|
||||||
async version(): Promise<string | undefined> {
|
async version(cwd: string): Promise<string | undefined> {
|
||||||
const rawOutput = await this.git().raw("version");
|
const rawOutput = await this.git(cwd).raw("version");
|
||||||
const match = rawOutput.match(/(\d+\.\d+(\.\d+)?)/);
|
const match = rawOutput.match(/(\d+\.\d+(\.\d+)?)/);
|
||||||
return match ? match[1] : undefined;
|
return match ? match[1] : undefined;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ beforeEach(() => {
|
||||||
|
|
||||||
describe("git cli service", () => {
|
describe("git cli service", () => {
|
||||||
test("version", async () => {
|
test("version", async () => {
|
||||||
const result = await git.version();
|
const result = await git.version(cwd);
|
||||||
const actualVersion = spawnSync("git", ["version"]).stdout.toString();
|
const actualVersion = spawnSync("git", ["version"]).stdout.toString();
|
||||||
const match = actualVersion.match(/(\d+\.\d+(\.\d+)?)/);
|
const match = actualVersion.match(/(\d+\.\d+(\.\d+)?)/);
|
||||||
if (match) {
|
if (match) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue