diff --git a/src/config.js b/src/config.js index 119a930..e9d58ff 100644 --- a/src/config.js +++ b/src/config.js @@ -27,11 +27,18 @@ const getRef = () => { const thisBranchName = () => { - const ref = getRef(); + try { + const ref = getRef(); - const refParts = ref.split('/'); + const refParts = ref.split('/'); - return refParts[refParts.length-1]; + return refParts[refParts.length-1]; + } + catch (error) { + core.error(`Unable to get current branch name : ${error.message}`); + } + + return DEFAULT_BRANCH_NAME; }; const isDefaultBranch = () => {