Skip to content

Commit 025b86f

Browse files
committed
Escape title in search query
This will prevent quotes from conflicting if they are present in the issue title being used in the query.
1 parent 08f89b4 commit 025b86f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/action.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export async function createAnIssue (tools: Toolkit) {
6262
if (updateExisting !== null) {
6363
tools.log.info(`Fetching issues with title "${templated.title}"`)
6464

65-
let query = `is:issue repo:${process.env.GITHUB_REPOSITORY} in:title '${templated.title}'`
65+
let query = `is:issue repo:${process.env.GITHUB_REPOSITORY} in:title '${templated.title.replace(/['"]/g, "\\$&")}'`
6666

6767
const searchExistingType = tools.inputs.search_existing || 'open'
6868
const allowedStates = ['open', 'closed']

0 commit comments

Comments
 (0)