Browse Source

meta(gha): Deploy action issue-status-helper.yml (#25927)

Burak Yigit Kaya 3 years ago
parent
commit
f2c194a7e0
1 changed files with 16 additions and 0 deletions
  1. 16 0
      .github/workflows/issue-status-helper.yml

+ 16 - 0
.github/workflows/issue-status-helper.yml

@@ -0,0 +1,16 @@
+name: Issue Status Helper
+on:
+  issues:
+    types: [labeled]
+jobs:
+  routed:
+    runs-on: ubuntu-latest
+    if: "startsWith(github.event.label.name, 'Status: ')"
+    steps:
+      - name: "Ensure a single 'Status: *' label"
+        env:
+          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          GH_REPO: ${{ github.repository }}
+        run: |
+          labels_to_remove=$(gh api "/repos/$GH_REPO/labels" -q '[.[].name | select(startswith("Status: ") and . != "${{ github.event.label.name }}")] | join(",")')
+          gh issue edit ${{ github.event.issue.number }} --remove-label "$labels_to_remove" --add-label "${{ github.event.label.name }}"