issue-labeled.yml 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. name: Issue Labeled
  2. on:
  3. issues:
  4. types: [labeled]
  5. permissions: # added using https://github.com/step-security/secure-workflows
  6. contents: read
  7. jobs:
  8. issue-labeled-with-status:
  9. name: status/{confirmed,reviewed} label added
  10. if: github.event.label.name == 'status/confirmed' || github.event.label.name == 'status/reviewed'
  11. runs-on: ubuntu-latest
  12. steps:
  13. - name: Generate GitHub App token
  14. uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
  15. id: generate-token
  16. with:
  17. creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
  18. org: electron
  19. - name: Set status
  20. uses: dsanders11/project-actions/edit-item@9c80cd31f58599941c64f74636bea95ba5d46090 # v1.5.1
  21. with:
  22. token: ${{ steps.generate-token.outputs.token }}
  23. project-number: 90
  24. field: Status
  25. field-value: ✅ Triaged
  26. fail-if-item-not-found: false
  27. issue-labeled-blocked:
  28. name: blocked/* label added
  29. if: startsWith(github.event.label.name, 'blocked/')
  30. runs-on: ubuntu-latest
  31. steps:
  32. - name: Generate GitHub App token
  33. uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
  34. id: generate-token
  35. with:
  36. creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
  37. org: electron
  38. - name: Set status
  39. uses: dsanders11/project-actions/edit-item@9c80cd31f58599941c64f74636bea95ba5d46090 # v1.5.1
  40. with:
  41. token: ${{ steps.generate-token.outputs.token }}
  42. project-number: 90
  43. field: Status
  44. field-value: 🛑 Blocked
  45. fail-if-item-not-found: false
  46. issue-labeled-blocked-need-repro:
  47. name: blocked/need-repro label added
  48. if: github.event.label.name == 'blocked/need-repro'
  49. permissions:
  50. issues: write # for actions-cool/issues-helper to update issues
  51. runs-on: ubuntu-latest
  52. steps:
  53. - name: Check if comment needed
  54. id: check-for-comment
  55. env:
  56. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  57. GH_REPO: electron/electron
  58. run: |
  59. set -eo pipefail
  60. COMMENT_COUNT=$(gh issue view ${{ github.event.issue.number }} --comments --json comments | jq '[ .comments[] | select(.author.login == "electron-issue-triage" or .authorAssociation == "OWNER" or .authorAssociation == "MEMBER") | select(.body | startswith("<!-- blocked/need-repro -->")) ] | length')
  61. if [[ $COMMENT_COUNT -eq 0 ]]; then
  62. echo "SHOULD_COMMENT=1" >> "$GITHUB_OUTPUT"
  63. fi
  64. - name: Generate GitHub App token
  65. if: ${{ steps.check-for-comment.outputs.SHOULD_COMMENT }}
  66. uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
  67. id: generate-token
  68. with:
  69. creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
  70. - name: Create comment
  71. if: ${{ steps.check-for-comment.outputs.SHOULD_COMMENT }}
  72. uses: actions-cool/issues-helper@a610082f8ac0cf03e357eb8dd0d5e2ba075e017e # v3.6.0
  73. with:
  74. actions: 'create-comment'
  75. token: ${{ steps.generate-token.outputs.token }}
  76. body: |
  77. <!-- blocked/need-repro -->
  78. Hello @${{ github.event.issue.user.login }}. Thanks for reporting this and helping to make Electron better!
  79. Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, [Electron Fiddle](https://www.electronjs.org/fiddle) is a great tool for making small test cases and makes it easy to publish your test case to a [gist](https://gist.github.com) that Electron maintainers can use.
  80. Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.
  81. Now adding the https://github.com/electron/electron/labels/blocked%2Fneed-repro label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.