Skip to content

Commit 9d60d76

Browse files
author
amvanbaren
committed
Add or remove dispute label to issue
1 parent 85f49c0 commit 9d60d76

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

.github/workflows/claim-namespace.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ jobs:
66
namespace:
77
name: Namespace Claim Checks
88
runs-on: ubuntu-latest
9+
permissions:
10+
issues: write
911
if: ${{ contains(github.event.issue.labels.*.name, 'namespace') && !contains(github.event.issue.labels.*.name, 'granted') && !contains(github.event.issue.labels.*.name, 'denied') && startsWith(github.event.issue.title, 'Claiming namespace') }}
1012
steps:
1113
- id: get_namespace
@@ -32,9 +34,21 @@ jobs:
3234
with:
3335
endpoint: https://open-vsx.org/api/${{steps.get_namespace.outputs.namespace}}
3436
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
37+
- id: namespace_dispute
38+
name: Namespace dispute
39+
if: ${{ fromJSON(steps.get_namespace_data.outputs.fetchApiData).verified == true && !contains(github.event.issue.labels.*.name, 'dispute') }}
40+
run: gh issue edit "$NUMBER" --add-label "$LABELS"
41+
env:
42+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
GH_REPO: ${{ github.repository }}
44+
NUMBER: ${{ github.event.issue.number }}
45+
LABELS: dispute
46+
- id: no_namespace_dispute
47+
name: Namespace not disputed
48+
if: ${{ fromJSON(steps.get_namespace_data.outputs.fetchApiData).verified == false && contains(github.event.issue.labels.*.name, 'dispute') }}
49+
run: gh issue edit "$NUMBER" --remove-label "$LABELS"
50+
env:
51+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
GH_REPO: ${{ github.repository }}
53+
NUMBER: ${{ github.event.issue.number }}
54+
LABELS: dispute

0 commit comments

Comments
 (0)