Skip to content

Commit 5d0f4db

Browse files
authored
Merge pull request #4254 from amvanbaren/namespace-claim-remove-not-planned
Namespace claim: check for ':' char
2 parents a52e6c7 + 3c28c8e commit 5d0f4db

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/claim-namespace.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@ jobs:
1515
uses: actions/github-script@v7
1616
with:
1717
script: |
18+
let namespace = context.payload.issue.title.substring('Claiming namespace'.length);
19+
if(namespace.startsWith(':')) {
20+
namespace = namespace.substring(1);
21+
}
22+
23+
namespace = namespace.trim();
1824
const delimiters = [{start: '[', end: ']'}, {start: '`', end: '`'}, {start: '"', end: '"'}, {start: "'", end: "'"}];
19-
let namespace = context.payload.issue.title.substring('Claiming namespace'.length).trim();
2025
for(const {start, end} of delimiters) {
2126
if(namespace.startsWith(start) && namespace.endsWith(end)) {
2227
namespace = namespace.substring(1, namespace.length - 1);
@@ -31,7 +36,7 @@ jobs:
3136
}
3237
- id: log_namespace
3338
name: Log namespace name
34-
run: echo "${{steps.get_namespace.outputs.namespace}}"
39+
run: echo '${{steps.get_namespace.outputs.namespace}}'
3540
- id: api_get_namespace
3641
name: Namespace API request
3742
uses: JamesIves/fetch-api-data-action@v2
@@ -42,7 +47,7 @@ jobs:
4247
if: ${{ failure() && steps.get_namespace.outputs.namespace != null }}
4348
run: |
4449
gh issue edit "$NUMBER" --add-assignee "$ASSIGNEE"
45-
gh issue close "$NUMBER" -c "The namespace $NAMESPACE doesn't exist. Please publish your extension first and then open a new namespace claim issue." -r "not planned"
50+
gh issue close "$NUMBER" -c "The namespace '$NAMESPACE' doesn't exist. Please publish your extension first and then open a new namespace claim issue." -r "not planned"
4651
env:
4752
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4853
GH_REPO: ${{ github.repository }}

0 commit comments

Comments
 (0)