Skip to content

Commit

Permalink
Replace special characters in git branch name with underscore
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Sep 22, 2024
1 parent 1b99ed7 commit 5f73481
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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("/"));
}
Expand Down

0 comments on commit 5f73481

Please sign in to comment.