xref: /expo/.github/workflows/issue-triage.yml (revision 9558d768)
1name: Issue Triage
2on:
3  issues:
4    types: [labeled]
5
6jobs:
7  needs-repro:
8    runs-on: ubuntu-22.04
9    if: "${{ contains(github.event.label.name, 'incomplete issue: missing or invalid repro') }}"
10    steps:
11      - uses: actions/github-script@v6
12        with:
13          github-token: ${{ secrets.EXPO_BOT_GITHUB_TOKEN }}
14          script: |
15            github.rest.issues.createComment({
16              issue_number: context.issue.number,
17              owner: context.repo.owner,
18              repo: context.repo.repo,
19              body: `Hi there! It looks like your issue requires a minimal reproducible example, but it is invalid or absent. Please prepare such an example and share it in a new issue.
20
21              **The best way to get attention to your issue is to provide a clean and easy way for a developer to reproduce the issue on their own machine.** Please do not provide your entire project, or a project with more code than is necessary to reproduce the issue.
22
23              A side benefit of going through the process of narrowing down the minimal amount of code needed to reproduce the issue is that you may get lucky and discover that the bug is due to a mistake in your application code that you can quickly fix on your own.
24
25              ### Resources
26
27              - ["How to create a Minimal, Reproducible Example"](https://stackoverflow.com/help/minimal-reproducible-example)
28              - ["How to narrow down the source of an error"](https://expo.fyi/manual-debugging)
29
30              ### Common concerns
31
32              #### "I've only been able to reproduce it in private, proprietary code"
33
34              You may not have spent enough time narrowing down the root cause of the issue. Try out the techniques discussed in this [manual debugging guide](https://expo.fyi/manual-debugging) to learn how to isolate the problem from the rest of your codebase.
35
36              #### "I didn't have time to create one"
37
38              That's understandable, it can take some time to prepare. We ask that you hold off on filing an issue until you are able to fully complete the required fields in the issue template.
39
40              #### "You can reproduce it by yourself by creating a project and following these steps"
41
42              This is useful knowledge, but it's still valuable to have the resulting project that is produced from running the steps, where you have verified you can reproduce the issue.
43            `})
44            github.rest.issues.update({
45              issue_number: context.issue.number,
46              owner: context.repo.owner,
47              repo: context.repo.repo,
48              state: 'closed'
49            })
50
51  needs-info:
52    runs-on: ubuntu-22.04
53    if: "${{ contains(github.event.label.name, 'incomplete issue: missing info') }}"
54    steps:
55      - uses: actions/github-script@v6
56        with:
57          github-token: ${{ secrets.EXPO_BOT_GITHUB_TOKEN }}
58          script: |
59            github.rest.issues.createComment({
60              issue_number: context.issue.number,
61              owner: context.repo.owner,
62              repo: context.repo.repo,
63              body: `Hello! There isn't enough information provided in your issue description for us to be able to help you. The best way to get help is to provide information to enable other developers to understand the issue and reproduce it on their own machines.
64
65              Please create a new issue and fill out the entire issue template to the best of your ability. Refer to the following resources for more information on how to create a good issue report.
66
67              ### Resources
68
69              - ["How do I ask a good question?"](https://stackoverflow.com/help/how-to-ask)
70              - ["How to create a Minimal, Reproducible Example"](https://stackoverflow.com/help/minimal-reproducible-example)
71              - ["How to narrow down the source of an error"](https://expo.fyi/manual-debugging)
72            `})
73            github.rest.issues.update({
74              issue_number: context.issue.number,
75              owner: context.repo.owner,
76              repo: context.repo.repo,
77              state: 'closed'
78            })
79
80  issue-accepted:
81    runs-on: ubuntu-22.04
82    if: github.event.label.name == 'issue accepted'
83    steps:
84      - name: Comment on issue
85        uses: actions/github-script@v6
86        with:
87          github-token: ${{ secrets.EXPO_BOT_GITHUB_TOKEN }}
88          script: |
89            github.rest.issues.createComment({
90              issue_number: context.issue.number,
91              owner: context.repo.owner,
92              repo: context.repo.repo,
93              body: `Thank you for filing this issue!
94              This comment acknowledges we believe this may be a bug and there’s enough information to investigate it.
95              However, we can’t promise any sort of timeline for resolution. We prioritize issues based on severity, breadth of impact, and alignment with our roadmap. If you’d like to help move it more quickly, you can continue to investigate it more deeply and/or you can open a pull request that fixes the cause.
96            `})
97      - name: �� Checkout
98        uses: actions/checkout@v3
99      - name: ➕ Add `bin` to GITHUB_PATH
100        run: echo "$(pwd)/bin" >> $GITHUB_PATH
101      - name: ♻️ Restore caches
102        uses: ./.github/actions/expo-caches
103        id: expo-caches
104        with:
105          yarn-tools: 'true'
106      - name: �� Import issue to Linear
107        run: expotools import-github-issue-to-linear --issue "${{ github.event.issue.number }}" --importer "${{ github.triggering_actor }}"
108        env:
109          GITHUB_TOKEN: ${{ secrets.EXPO_BOT_GITHUB_TOKEN }}
110          LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }}
111          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
112
113  question:
114    runs-on: ubuntu-22.04
115    if: "${{ contains(github.event.label.name, 'invalid issue: question') }}"
116    steps:
117      - uses: actions/github-script@v6
118        with:
119          github-token: ${{ secrets.EXPO_BOT_GITHUB_TOKEN }}
120          script: |
121            github.rest.issues.createComment({
122              issue_number: context.issue.number,
123              owner: context.repo.owner,
124              repo: context.repo.repo,
125              body: `Hello! Our GitHub issues are reserved for bug reports.
126
127              If you have a question about Expo or related tools, please post on our forums at https://forums.expo.dev/ or join our Discord at https://chat.expo.dev/.
128
129              ### Resources
130
131              - ["How do I ask a good question?"](https://stackoverflow.com/help/how-to-ask)
132              - ["Join the community"](https://docs.expo.dev/next-steps/community/)
133            `})
134            github.rest.issues.update({
135              issue_number: context.issue.number,
136              owner: context.repo.owner,
137              repo: context.repo.repo,
138              state: 'closed'
139            })
140
141  feature-request:
142    runs-on: ubuntu-22.04
143    if: "${{ contains(github.event.label.name, 'invalid issue: feature request') }}"
144    steps:
145      - uses: actions/github-script@v6
146        with:
147          github-token: ${{ secrets.EXPO_BOT_GITHUB_TOKEN }}
148          script: |
149            github.rest.issues.createComment({
150              issue_number: context.issue.number,
151              owner: context.repo.owner,
152              repo: context.repo.repo,
153              body: `Hello! Our GitHub issues are reserved for bug reports.
154
155              If you would like to request a feature, please post to https://expo.canny.io/feature-requests.
156            `})
157            github.rest.issues.update({
158              issue_number: context.issue.number,
159              owner: context.repo.owner,
160              repo: context.repo.repo,
161              state: 'closed'
162            })
163
164  third-party:
165    runs-on: ubuntu-22.04
166    if: "${{ contains(github.event.label.name, 'invalid issue: third-party library') }}"
167    steps:
168      - uses: actions/github-script@v6
169        with:
170          github-token: ${{ secrets.EXPO_BOT_GITHUB_TOKEN }}
171          script: |
172            github.rest.issues.createComment({
173              issue_number: context.issue.number,
174              owner: context.repo.owner,
175              repo: context.repo.repo,
176              body: `Hi there! It looks like your issue is more closely related to a third-party tool.
177
178              If you are able to narrow down the root cause to a bug relevant to this repository, please create an issue here with a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). Otherwise, we recommend posting this issue to the repository for the tool that you are using.
179
180              ### Resources
181
182              - ["How to create a Minimal, Reproducible Example"](https://stackoverflow.com/help/minimal-reproducible-example)
183              - ["How to narrow down the source of an error"](https://expo.fyi/manual-debugging)
184            `})
185            github.rest.issues.update({
186              issue_number: context.issue.number,
187              owner: context.repo.owner,
188              repo: context.repo.repo,
189              state: 'closed'
190            })
191  react-native-core:
192    runs-on: ubuntu-22.04
193    if: "${{ contains(github.event.label.name, 'invalid issue: react-native-core') }}"
194    steps:
195      - uses: actions/github-script@v6
196        with:
197          github-token: ${{ secrets.EXPO_BOT_GITHUB_TOKEN }}
198          script: |
199            github.rest.issues.createComment({
200              issue_number: context.issue.number,
201              owner: context.repo.owner,
202              repo: context.repo.repo,
203              body: `Hi there! It looks like your issue concerns code in react-native core, rather than Expo tools.
204
205              We recommend posting this issue directly to the [react-native repository](https://github.com/facebook/react-native/issues/new/choose).
206            `})
207            github.rest.issues.update({
208              issue_number: context.issue.number,
209              owner: context.repo.owner,
210              repo: context.repo.repo,
211              state: 'closed'
212            })
213