issue-labeled.yml 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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@438b25e007c2f4efec324497fadc6402e7cc61a6 # v1.4.0
  21. with:
  22. token: ${{ steps.generate-token.outputs.token }}
  23. project-number: 90
  24. field: Status
  25. field-value: ✅ Triaged
  26. issue-labeled-blocked:
  27. name: blocked/* label added
  28. if: startsWith(github.event.label.name, 'blocked/')
  29. runs-on: ubuntu-latest
  30. steps:
  31. - name: Generate GitHub App token
  32. uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
  33. id: generate-token
  34. with:
  35. creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
  36. org: electron
  37. - name: Set status
  38. uses: dsanders11/project-actions/edit-item@438b25e007c2f4efec324497fadc6402e7cc61a6 # v1.4.0
  39. with:
  40. token: ${{ steps.generate-token.outputs.token }}
  41. project-number: 90
  42. field: Status
  43. field-value: 🛑 Blocked
  44. issue-labeled-blocked-need-repro:
  45. name: blocked/need-repro label added
  46. if: github.event.label.name == 'blocked/need-repro'
  47. permissions:
  48. issues: write # for actions-cool/issues-helper to update issues
  49. runs-on: ubuntu-latest
  50. steps:
  51. - name: Check if comment needed
  52. id: check-for-comment
  53. env:
  54. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  55. GH_REPO: electron/electron
  56. run: |
  57. set -eo pipefail
  58. 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')
  59. if [[ $COMMENT_COUNT -eq 0 ]]; then
  60. echo "SHOULD_COMMENT=1" >> "$GITHUB_OUTPUT"
  61. fi
  62. - name: Generate GitHub App token
  63. if: ${{ steps.check-for-comment.outputs.SHOULD_COMMENT }}
  64. uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
  65. id: generate-token
  66. with:
  67. creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
  68. - name: Create comment
  69. if: ${{ steps.check-for-comment.outputs.SHOULD_COMMENT }}
  70. uses: actions-cool/issues-helper@a610082f8ac0cf03e357eb8dd0d5e2ba075e017e # v3.6.0
  71. with:
  72. actions: 'create-comment'
  73. token: ${{ steps.generate-token.outputs.token }}
  74. body: |
  75. <!-- blocked/need-repro -->
  76. Hello @${{ github.event.issue.user.login }}. Thanks for reporting this and helping to make Electron better!
  77. 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.
  78. 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.
  79. 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.