diff --git a/README.md b/README.md index 2d0bf3a..7176a0f 100644 --- a/README.md +++ b/README.md @@ -344,7 +344,7 @@ jobs: ### Filtering issues, pull requests and discussions This step will lock only issues, and exclude issues created before 2018, -or those with the `upstream` or `help-wanted` labels applied. +or those with the `help wanted` or `upstream` labels applied. ```yaml @@ -352,7 +352,7 @@ or those with the `upstream` or `help-wanted` labels applied. - uses: dessant/lock-threads@v5 with: exclude-issue-created-before: '2018-01-01T00:00:00Z' - exclude-any-issue-labels: 'upstream, help-wanted' + exclude-any-issue-labels: 'help wanted, upstream' process-only: 'issues' ``` @@ -393,11 +393,10 @@ labels applied. include-any-issue-labels: 'incomplete, invalid' include-all-pr-labels: 'qa: done, published' process-only: 'issues, prs' - ``` This step will lock discussions that have not had any activity -in the past 180 days. +in the past 180 days, and have the `qa: verified` label applied. ```yaml @@ -405,8 +404,8 @@ in the past 180 days. - uses: dessant/lock-threads@v5 with: discussion-inactive-days: '180' + include-any-discussion-labels: 'qa: verified' process-only: 'discussions' - ``` ### Commenting and labeling diff --git a/src/index.js b/src/index.js index acf48f6..a8f3055 100644 --- a/src/index.js +++ b/src/index.js @@ -226,12 +226,16 @@ class App { .map(label => `label:"${label}"`) .join(' ')}`; } else if (includeAnyLabels) { - query += ` label:${includeAnyLabels.join(',')}`; + query += ` label:${includeAnyLabels + .map(label => `"${label}"`) + .join(',')}`; } const excludeAnyLabels = this.config[`exclude-any-${threadType}-labels`]; if (excludeAnyLabels) { - query += ` -label:${excludeAnyLabels.join(',')}`; + query += ` -label:${excludeAnyLabels + .map(label => `"${label}"`) + .join(',')}`; } const excludeCreatedQuery = this.getFilterByDateQuery({ diff --git a/src/schema.js b/src/schema.js index 5e119c7..392dc3f 100644 --- a/src/schema.js +++ b/src/schema.js @@ -11,7 +11,10 @@ const extendedJoi = Joi.extend(joi => { if (value) { value = value .split(',') - .map(item => item.trim()) + .map(item => + // remove quotes around list item + item.replace(/^\s*["'](.+)["']\s*$/, '$1').trim() + ) .filter(Boolean); }