From 5f7348148e643627a265b6dcf5d962c91b1d7172 Mon Sep 17 00:00:00 2001 From: Vitalii Mikhailov Date: Sun, 22 Sep 2024 13:06:11 +0300 Subject: [PATCH] Replace special characters in git branch name with underscore --- .github/workflows/reusable-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index 71466e8c1..27fe05af9 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -44,11 +44,11 @@ jobs: uses: actions/github-script@v7 with: script: | - let gitHash = "${{ steps.git-vars.outputs.git_hash }}"; let runNumber = "${{ github.run_number }}"; + let gitHash = "${{ steps.git-vars.outputs.git_hash }}"; let rawGitRef = "${{ steps.git-vars.outputs.git_branch }}"; console.log("rawGitRef: " + rawGitRef); - let gitRef = rawGitRef.replace(/^refs\/heads\//, ""); + let gitRef = rawGitRef.replace(/^refs\/heads\//, "").replace(/^refs\/heads\//, "").replace(/[//!@#$%&]/g, "_"); if(gitRef.indexOf("refs/pull/") === 0) { gitRef = "pr-" + gitRef.substring(10, gitRef.lastIndexOf("/")); }