issue-unlabeled.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. name: Issue Unlabeled
  2. on:
  3. issues:
  4. types: [unlabeled]
  5. permissions:
  6. contents: read
  7. jobs:
  8. issue-unlabeled-blocked:
  9. name: All blocked/* labels removed
  10. if: startsWith(github.event.label.name, 'blocked/')
  11. runs-on: ubuntu-latest
  12. steps:
  13. - name: Check for any blocked labels
  14. id: check-for-blocked-labels
  15. run: |
  16. set -eo pipefail
  17. BLOCKED_LABEL_COUNT=$(echo '${{ toJSON(github.event.issue.labels.*.name) }}' | jq '[ .[] | select(startswith("blocked/")) ] | length')
  18. if [[ $BLOCKED_LABEL_COUNT -eq 0 ]]; then
  19. echo "NOT_BLOCKED=1" >> "$GITHUB_OUTPUT"
  20. fi
  21. - name: Generate GitHub App token
  22. if: ${{ steps.check-for-blocked-labels.outputs.NOT_BLOCKED }}
  23. uses: electron/github-app-auth-action@cc6751b3b5e4edc5b9a4ad0a021ac455653b6dc8 # v1.0.0
  24. id: generate-token
  25. with:
  26. creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
  27. org: electron
  28. - name: Set status
  29. if: ${{ steps.check-for-blocked-labels.outputs.NOT_BLOCKED }}
  30. uses: github/update-project-action@2d475e08804f11f4022df7e21f5816531e97cb64 # v2
  31. with:
  32. github_token: ${{ steps.generate-token.outputs.token }}
  33. organization: electron
  34. project_number: 90
  35. content_id: ${{ github.event.issue.node_id }}
  36. field: Status
  37. value: 📥 Was Blocked