issue-unlabeled.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. id: generate-token
  24. env:
  25. RELEASE_BOARD_GH_APP_CREDS: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }}
  26. run: |
  27. set -eo pipefail
  28. TOKEN=$(npx @electron/github-app-auth --creds=$RELEASE_BOARD_GH_APP_CREDS --org=electron)
  29. echo "TOKEN=$TOKEN" >> "$GITHUB_OUTPUT"
  30. - name: Set status
  31. if: ${{ steps.generate-token.outputs.TOKEN }}
  32. uses: github/update-project-action@2d475e08804f11f4022df7e21f5816531e97cb64 # v2
  33. with:
  34. github_token: ${{ steps.generate-token.outputs.TOKEN }}
  35. organization: electron
  36. project_number: 90
  37. content_id: ${{ github.event.issue.node_id }}
  38. field: Status
  39. value: 📥 Was Blocked