issue-labeled.yml 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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-blocked:
  9. name: blocked/* label added
  10. if: startsWith(github.event.label.name, 'blocked/')
  11. runs-on: ubuntu-latest
  12. steps:
  13. - name: Generate GitHub App token
  14. uses: electron/github-app-auth-action@cc6751b3b5e4edc5b9a4ad0a021ac455653b6dc8 # v1.0.0
  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@a24415515fa60a22f71f9d9d00e36ca82660cde9 # v1.0.1
  21. with:
  22. token: ${{ steps.generate-token.outputs.token }}
  23. project-number: 90
  24. field: Status
  25. field-value: 🛑 Blocked
  26. issue-labeled-blocked-need-repro:
  27. name: blocked/need-repro label added
  28. if: github.event.label.name == 'blocked/need-repro'
  29. permissions:
  30. issues: write # for actions-cool/issues-helper to update issues
  31. runs-on: ubuntu-latest
  32. steps:
  33. - name: Check if comment needed
  34. id: check-for-comment
  35. env:
  36. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  37. GH_REPO: electron/electron
  38. run: |
  39. set -eo pipefail
  40. 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')
  41. if [[ $COMMENT_COUNT -eq 0 ]]; then
  42. echo "SHOULD_COMMENT=1" >> "$GITHUB_OUTPUT"
  43. fi
  44. - name: Generate GitHub App token
  45. if: ${{ steps.check-for-comment.outputs.SHOULD_COMMENT }}
  46. uses: electron/github-app-auth-action@cc6751b3b5e4edc5b9a4ad0a021ac455653b6dc8 # v1.0.0
  47. id: generate-token
  48. with:
  49. creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
  50. - name: Create comment
  51. if: ${{ steps.check-for-comment.outputs.SHOULD_COMMENT }}
  52. uses: actions-cool/issues-helper@275328970dbc3bfc3bc43f5fe741bf3638300c0a # v3.3.3
  53. with:
  54. actions: 'create-comment'
  55. token: ${{ steps.generate-token.outputs.token }}
  56. body: |
  57. <!-- blocked/need-repro -->
  58. Hello @${{ github.event.issue.user.login }}. Thanks for reporting this and helping to make Electron better!
  59. 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.
  60. 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.
  61. 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.