File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Claim Namespace
2
+ on :
3
+ issues :
4
+ types : [opened]
5
+ jobs :
6
+ namespace :
7
+ name : Namespace Claim Checks
8
+ runs-on : ubuntu-latest
9
+ if : contains(github.event.issue.labels, 'namespace') && startsWith(github.event.issue.title, 'Claiming namespace')
10
+ steps :
11
+ - id : get_namespace
12
+ name : Get namespace name
13
+ uses : actions/github-script@v7
14
+ with :
15
+ script : |
16
+ let namespace = context.payload.issue.title.substring('Claiming namespace'.length).trim();
17
+ if((namespace.startsWith('[') && namespace.endsWith(']')) || (namespace.startsWith('`') && namespace.endsWith('`'))) {
18
+ namespace = namespace.substring(1, namespace.length - 1);
19
+ }
20
+
21
+ if(!namespace) {
22
+ core.setFailed('Could not get namespace name');
23
+ } else {
24
+ core.setOutput('namespace', namespace);
25
+ }
26
+ - id : log_namespace
27
+ name : Log namespace name
28
+ run : echo "${{steps.get_namespace.outputs.namespace}}"
29
+ - id : get_namespace_data
30
+ name : Namespace API request
31
+ uses : JamesIves/fetch-api-data-action@v2
32
+ with :
33
+ endpoint : https://open-vsx.org/api/${{steps.get_namespace.outputs.namespace}}
34
+ configuration : ' { "method": "GET" }'
35
+ - id : is_claimed
36
+ name : Is claimed namespace
37
+ if : fromJSON(steps.get_namespace_data.outputs.fetchApiData).verified == true
38
+ run : |
39
+ echo -e "Namespace ${{steps.get_namespace.outputs.namespace}} is already claimed.\nMore manual checks needed."
40
+ exit 1
You can’t perform that action at this time.
0 commit comments