Skip to content

Commit

Permalink
Escape title in search query
Browse files Browse the repository at this point in the history
This will prevent quotes from conflicting if they are present in the issue title being used in the query.
  • Loading branch information
parkerbxyz committed Dec 8, 2022
1 parent 08f89b4 commit 025b86f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export async function createAnIssue (tools: Toolkit) {
if (updateExisting !== null) {
tools.log.info(`Fetching issues with title "${templated.title}"`)

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

const searchExistingType = tools.inputs.search_existing || 'open'
const allowedStates = ['open', 'closed']
Expand Down

0 comments on commit 025b86f

Please sign in to comment.