Skip to content

Commit f6bb329

Browse files
authored
Merge pull request #4210 from amvanbaren/quotes-namespace-name
Add quote delimiters
2 parents ef02897 + da1bc45 commit f6bb329

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/claim-namespace.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ jobs:
1515
uses: actions/github-script@v7
1616
with:
1717
script: |
18+
const delimiters = [{start: '[', end: ']'}, {start: '`', end: '`'}, {start: '"', end: '"'}, {start: "'", end: "'"}];
1819
let namespace = context.payload.issue.title.substring('Claiming namespace'.length).trim();
19-
if((namespace.startsWith('[') && namespace.endsWith(']')) || (namespace.startsWith('`') && namespace.endsWith('`'))) {
20-
namespace = namespace.substring(1, namespace.length - 1);
20+
for(const {start, end} of delimiters) {
21+
if(namespace.startsWith(start) && namespace.endsWith(end)) {
22+
namespace = namespace.substring(1, namespace.length - 1);
23+
break;
24+
}
2125
}
2226
2327
if(!namespace) {

0 commit comments

Comments
 (0)