issue-labeled.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. id: generate-token
  15. env:
  16. RELEASE_BOARD_GH_APP_CREDS: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }}
  17. run: |
  18. set -eo pipefail
  19. TOKEN=$(npx @electron/github-app-auth --creds=$RELEASE_BOARD_GH_APP_CREDS --org=electron)
  20. echo "TOKEN=$TOKEN" >> "$GITHUB_OUTPUT"
  21. - name: Set status
  22. if: ${{ steps.generate-token.outputs.TOKEN }}
  23. uses: github/update-project-action@2d475e08804f11f4022df7e21f5816531e97cb64 # v2
  24. with:
  25. github_token: ${{ steps.generate-token.outputs.TOKEN }}
  26. organization: electron
  27. project_number: 90
  28. content_id: ${{ github.event.issue.node_id }}
  29. field: Status
  30. value: 🛑 Blocked
  31. issue-labeled-blocked-need-repro:
  32. name: blocked/need-repro label added
  33. if: github.event.label.name == 'blocked/need-repro'
  34. permissions:
  35. issues: write # for actions-cool/issues-helper to update issues
  36. runs-on: ubuntu-latest
  37. steps:
  38. - name: Check if comment needed
  39. id: check-for-comment
  40. env:
  41. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  42. GH_REPO: electron/electron
  43. run: |
  44. set -eo pipefail
  45. COMMENT_COUNT=$(gh issue view ${{ github.event.issue.number }} --comments --json comments | jq '[ .comments[] | select(.author.login == "github-actions" or .authorAssociation == "OWNER" or .authorAssociation == "MEMBER") | select(.body | startswith("<!-- blocked/need-repro -->")) ] | length')
  46. if [[ $COMMENT_COUNT -eq 0 ]]; then
  47. echo "SHOULD_COMMENT=1" >> "$GITHUB_OUTPUT"
  48. fi
  49. - name: Create comment
  50. if: ${{ steps.check-for-comment.outputs.SHOULD_COMMENT }}
  51. uses: actions-cool/issues-helper@275328970dbc3bfc3bc43f5fe741bf3638300c0a # v3.3.3
  52. with:
  53. actions: 'create-comment'
  54. body: |
  55. <!-- blocked/need-repro -->
  56. Hello @${{ github.event.issue.user.login }}. Thanks for reporting this and helping to make Electron better!
  57. 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.
  58. 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.
  59. 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.