From d4eee0f98141d0c3d6fc06e26c74301ad3ebea1e Mon Sep 17 00:00:00 2001 From: Uku Pattak Date: Mon, 26 Feb 2024 12:42:51 +0200 Subject: [PATCH] Remove caret as well --- dist/index.js | 2 +- package.json | 2 +- src/main.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index 9b7f6d5..d341c3d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -35939,7 +35939,7 @@ ${links}`; exports.run = run; async function getBranchName(path) { const branchName = await (0, bash_1.exec)(`git -C ${path} name-rev --name-only HEAD`); - return branchName.replace('remotes/origin/', '').replace(/~.*$/, ''); + return branchName.replace('remotes/origin/', '').replace(/(~|\^).*$/, ''); } async function getBehind(path, commitHash) { const behind = await (0, bash_1.exec)(`git -C ${path} rev-list --count HEAD..origin/main`); diff --git a/package.json b/package.json index 6c40f69..5556f66 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@remato/submodule-status-commenter", - "version": "2.0.1", + "version": "2.0.2", "license": "MIT", "description": "GitHub action to comment submodules current branch and state to the PR", "main": "dist/index.js", diff --git a/src/main.ts b/src/main.ts index cd8b718..4fc4cb2 100644 --- a/src/main.ts +++ b/src/main.ts @@ -40,7 +40,7 @@ ${links}` async function getBranchName(path: string) { const branchName = await exec(`git -C ${path} name-rev --name-only HEAD`) - return branchName.replace('remotes/origin/', '').replace(/~.*$/, '') + return branchName.replace('remotes/origin/', '').replace(/(~|\^).*$/, '') } async function getBehind(path: string, commitHash: string) {