issue-unlabeled.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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/') && github.event.issue.state == 'open'
  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: dsanders11/project-actions/edit-item@a24415515fa60a22f71f9d9d00e36ca82660cde9 # v1.0.1
  31. with:
  32. token: ${{ steps.generate-token.outputs.token }}
  33. project-number: 90
  34. field: Status
  35. field-value: 📥 Was Blocked