Skip to content

Commit 7f993a1

Browse files
authored
Merge pull request #4213 from amvanbaren/namespace-not-found
Check if namespace exists
2 parents f6bb329 + 1ec7206 commit 7f993a1

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

.github/workflows/claim-namespace.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,24 @@ jobs:
3232
- id: log_namespace
3333
name: Log namespace name
3434
run: echo "${{steps.get_namespace.outputs.namespace}}"
35-
- id: get_namespace_data
35+
- id: api_get_namespace
36+
name: Namespace API request
37+
uses: JamesIves/fetch-api-data-action@v2
38+
with:
39+
endpoint: https://open-vsx.org/api/${{steps.get_namespace.outputs.namespace}}
40+
configuration: '{ "method": "GET" }'
41+
- id: namespace_not_found
42+
if: ${{ failure() && steps.get_namespace.outputs.namespace != null }}
43+
run: |
44+
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"
46+
env:
47+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
GH_REPO: ${{ github.repository }}
49+
NUMBER: ${{ github.event.issue.number }}
50+
NAMESPACE: ${{ steps.get_namespace.outputs.namespace }}
51+
ASSIGNEE: amvanbaren
52+
- id: api_get_namespace_members
3653
name: Namespace members API request
3754
uses: JamesIves/fetch-api-data-action@v2
3855
with:
@@ -41,7 +58,7 @@ jobs:
4158
- id: namespace_members
4259
uses: actions/github-script@v7
4360
env:
44-
DATA: ${{ steps.get_namespace_data.outputs.fetchApiData }}
61+
DATA: ${{ steps.api_get_namespace_members.outputs.fetchApiData }}
4562
with:
4663
script: |
4764
const json = JSON.parse(process.env.DATA);

0 commit comments

Comments
 (0)