Skip to content

Commit

Permalink
CWP-59209: support double quotes in branch name (#59)
Browse files Browse the repository at this point in the history
* Update scanner.js

* Update index.js

* update branchname
  • Loading branch information
tarunaluguri committed Sep 5, 2023
1 parent 65e6d09 commit df1ce91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21407,7 +21407,7 @@ const executeScan = function () {
let logLevel = core.getInput('log_level');
const context = github.context;
const repo = context.payload.repository
var branchName = process.env.GITHUB_REF_NAME;
let branchName = process.env.GITHUB_REF_NAME;
const repoDetails = {
'default_branch' : repo.default_branch,
'full_name' : repo.full_name,
Expand Down Expand Up @@ -21445,6 +21445,7 @@ const executeScan = function () {
let runNumber = context.runNumber
let sha = context.sha.replace(regExp, '')
logLevel = logLevel.replace(regExp, '')
branchName = branchName.replace(/[\"]/g, '\\\"')
if (outputFormat.length > 0) {
let outformatValid = validateOutputFormat(outputFormat)
if (!outformatValid) {
Expand Down
3 changes: 2 additions & 1 deletion src/zscanner/scanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const executeScan = function () {
let logLevel = core.getInput('log_level');
const context = github.context;
const repo = context.payload.repository
var branchName = process.env.GITHUB_REF_NAME;
let branchName = process.env.GITHUB_REF_NAME;
const repoDetails = {
'default_branch' : repo.default_branch,
'full_name' : repo.full_name,
Expand Down Expand Up @@ -109,6 +109,7 @@ const executeScan = function () {
let runNumber = context.runNumber
let sha = context.sha.replace(regExp, '')
logLevel = logLevel.replace(regExp, '')
branchName = branchName.replace(/[\"]/g, '\\\"')
if (outputFormat.length > 0) {
let outformatValid = validateOutputFormat(outputFormat)
if (!outformatValid) {
Expand Down

0 comments on commit df1ce91

Please sign in to comment.