Skip to content
This repository was archived by the owner on Nov 27, 2022. It is now read-only.

Commit 83b1b55

Browse files
committed
chore: update issue templates and workflows
1 parent ee11e2a commit 83b1b55

File tree

12 files changed

+299
-74
lines changed

12 files changed

+299
-74
lines changed

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: React Navigation 5
2+
description: Report an issue with React Navigation 5
3+
labels: [bug]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to fill out this bug report!
9+
10+
If this is not a bug report, please use other relevant channels:
11+
12+
- [Ask questions on Discussions](https://github.com/satya164/react-native-tab-view/discussions)
13+
- [Chat with others in the #help-react-native channel on Discord](https://www.reactiflux.com/)
14+
15+
- type: textarea
16+
attributes:
17+
label: Current behavior
18+
description: |
19+
What code are you running and what is happening? Include a screenshot or video if it's an UI related issue.
20+
placeholder: Current behavior
21+
validations:
22+
required: true
23+
- type: textarea
24+
attributes:
25+
label: Expected behavior
26+
description: |
27+
What do you expect to happen instead?
28+
placeholder: Expected behavior
29+
validations:
30+
required: true
31+
- type: input
32+
attributes:
33+
label: Reproduction
34+
description: |
35+
You must provide a way to reproduce the problem. If you don't provide a repro, the issue will be closed automatically after a specific period.
36+
37+
- Either re-create the bug on [Snack](https://snack.expo.dev) or link to a GitHub repository with code that reproduces the bug.
38+
- Explain how to run the example app and any steps that we need to take to reproduce the issue from the example app.
39+
- Keep the repro code as simple as possible, with the minimum amount of code required to repro the issue.
40+
- Before reporting an issue, make sure you are on latest version of the package.
41+
- If you are having an issue with your machine or build tools, the issue belongs on another repository as that is outside of the scope of the library.
42+
placeholder: Link to repro
43+
validations:
44+
required: true
45+
- type: checkboxes
46+
attributes:
47+
label: Platform
48+
description: |
49+
What are the platforms where you see the issue?
50+
options:
51+
- label: Android
52+
- label: iOS
53+
- label: Web
54+
- label: Windows
55+
- label: MacOS
56+
- type: textarea
57+
attributes:
58+
label: Environment
59+
description: |
60+
What are the exact versions of packages that you are using?
61+
value: |
62+
| package | version |
63+
| -------------------------------------- | ------- |
64+
| react-native-tab-view |
65+
| react-native-pager-view |
66+
| react-native |
67+
| expo |
68+
| node |
69+
| npm or yarn |
70+
validations:
71+
required: true

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 45 deletions
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
<!-- Please provide enough information so that others can review your pull request. -->
2-
<!-- Keep pull requests small and focused on a single change. -->
1+
Please provide enough information so that others can review your pull request:
32

4-
### Motivation
3+
**Motivation**
54

6-
<!-- What existing problem does the pull request solve? Can you solve the issue with a different approach? -->
5+
Explain the **motivation** for making this change. What existing problem does the pull request solve?
76

8-
### Test plan
7+
**Test plan**
98

10-
<!-- List the steps with which we can test this change. Provide screenshots if this changes anything visual. -->
9+
Demonstrate the code is solid. Example: the exact commands you ran and their output, screenshots / videos if the pull request changes UI.
10+
11+
Make sure you test on both platforms if your change affects both platforms.
12+
13+
The code must pass tests.
14+
15+
**Code formatting**
16+
17+
Look around. Match the style of the rest of the codebase. Run `yarn lint --fix` before committing.

.github/workflows/check-labels.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Check for labels
2+
on:
3+
issues:
4+
types: [opened, edited]
5+
6+
jobs:
7+
check-labels:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/github-script@v3
11+
with:
12+
github-token: ${{ secrets.GITHUB_TOKEN }}
13+
script: |
14+
const body = context.payload.issue.body;
15+
16+
const labels = Array.from(
17+
body.matchAll(/- \[x\] (Android|iOS|Web|Windows|MacOS)/gim)
18+
).map((matches) => `platform:${matches[1].toLowerCase()}`);
19+
20+
if (labels.length) {
21+
await github.issues.addLabels({
22+
issue_number: context.issue.number,
23+
owner: context.repo.owner,
24+
repo: context.repo.repo,
25+
labels,
26+
});
27+
}

.github/workflows/check-repro.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Check for repro
2+
on:
3+
issues:
4+
types: [opened, edited]
5+
issue_comment:
6+
types: [created, edited]
7+
8+
jobs:
9+
check-repro:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/github-script@v3
13+
with:
14+
github-token: ${{ secrets.GITHUB_TOKEN }}
15+
script: |
16+
const user = context.payload.sender.login;
17+
const body = context.payload.comment
18+
? context.payload.comment.body
19+
: context.payload.issue.body;
20+
21+
const regex = new RegExp(
22+
`https?:\\/\\/((github\\.com\\/${user}\\/[^/]+\\/?[\\s\\n]+)|(snack\\.expo\\.dev\\/.+))`,
23+
'gm'
24+
);
25+
26+
if (regex.test(body)) {
27+
await github.issues.addLabels({
28+
issue_number: context.issue.number,
29+
owner: context.repo.owner,
30+
repo: context.repo.repo,
31+
labels: ['repro provided'],
32+
});
33+
34+
try {
35+
await github.issues.removeLabel({
36+
issue_number: context.issue.number,
37+
owner: context.repo.owner,
38+
repo: context.repo.repo,
39+
name: 'needs repro',
40+
});
41+
} catch (error) {
42+
if (!/Label does not exist/.test(error.message)) {
43+
throw error;
44+
}
45+
}
46+
} else {
47+
if (context.eventName !== 'issues') {
48+
return;
49+
}
50+
51+
const body = "Hey! Thanks for opening the issue. The issue doesn't seem to contain a link to a repro (a [snack.expo.dev](https://snack.expo.dev) link or link to a GitHub repo under your username).\n\nCan you provide a [minimal repro](https://stackoverflow.com/help/minimal-reproducible-example) which demonstrates the issue? A repro will help us debug the issue faster. Please try to keep the repro as small as possible and make sure that we can run it without additional setup.";
52+
53+
const comments = await github.issues.listComments({
54+
issue_number: context.issue.number,
55+
owner: context.repo.owner,
56+
repo: context.repo.repo,
57+
});
58+
59+
if (comments.data.some(comment => comment.body === body)) {
60+
return;
61+
}
62+
63+
await github.issues.createComment({
64+
issue_number: context.issue.number,
65+
owner: context.repo.owner,
66+
repo: context.repo.repo,
67+
body,
68+
});
69+
70+
await github.issues.addLabels({
71+
issue_number: context.issue.number,
72+
owner: context.repo.owner,
73+
repo: context.repo.repo,
74+
labels: ['needs repro'],
75+
});
76+
}

.github/workflows/expo-preview.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,12 @@ jobs:
1313
- name: Setup Node.js
1414
uses: actions/setup-node@v1
1515
with:
16-
node-version: 10.x
16+
node-version: 14.x
1717

1818
- name: Setup Expo
19-
uses: expo/expo-github-action@v5
19+
uses: expo/expo-github-action@v6
2020
with:
21-
expo-version: 3.x
22-
expo-username: ${{ secrets.EXPO_CLI_USERNAME }}
23-
expo-password: ${{ secrets.EXPO_CLI_PASSWORD }}
24-
expo-cache: true
21+
token: ${{ secrets.EXPO_TOKEN }}
2522

2623
- name: Restore yarn cache
2724
id: yarn-cache
@@ -38,7 +35,7 @@ jobs:
3835
3936
- name: Publish Expo app
4037
working-directory: ./example
41-
run: expo publish --release-channel=pr-${{ github.event.number }}
38+
run: yarn expo publish --release-channel=pr-${{ github.event.number }}
4239
env:
4340
EXPO_USE_DEV_SERVER: true
4441

@@ -47,7 +44,7 @@ jobs:
4744
run: echo "::set-output name=path::@satya164/react-native-tab-view-demos?release-channel=pr-${{ github.event.number }}
4845

4946
- name: Comment on PR
50-
uses: actions/github-script@v2
47+
uses: actions/github-script@v3
5148
with:
5249
github-token: ${{secrets.GITHUB_TOKEN}}
5350
script: |

.github/workflows/expo.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
branches:
55
- main
6+
workflow_dispatch:
67

78
jobs:
89
publish:
@@ -15,15 +16,12 @@ jobs:
1516
- name: Setup Node.js
1617
uses: actions/setup-node@v1
1718
with:
18-
node-version: 10.x
19+
node-version: 14.x
1920

2021
- name: Setup Expo
21-
uses: expo/expo-github-action@v5
22+
uses: expo/expo-github-action@v6
2223
with:
23-
expo-version: 3.x
24-
expo-username: ${{ secrets.EXPO_CLI_USERNAME }}
25-
expo-password: ${{ secrets.EXPO_CLI_PASSWORD }}
26-
expo-cache: true
24+
token: ${{ secrets.EXPO_TOKEN }}
2725

2826
- name: Restore yarn cache
2927
id: yarn-cache
@@ -40,4 +38,4 @@ jobs:
4038
4139
- name: Publish Expo app
4240
working-directory: ./example
43-
run: expo publish
41+
run: yarn expo publish
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: First pull request
2+
on: pull_request_target
3+
4+
jobs:
5+
welcome:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/github-script@v3
9+
with:
10+
github-token: ${{secrets.GITHUB_TOKEN}}
11+
script: |
12+
// Get a list of all issues created by the PR opener
13+
// See: https://octokit.github.io/rest.js/#pagination
14+
const creator = context.payload.sender.login;
15+
const options = github.issues.listForRepo.endpoint.merge({
16+
...context.issue,
17+
creator,
18+
state: 'all'
19+
});
20+
21+
const issues = await github.paginate(options);
22+
23+
for (const issue of issues) {
24+
if (issue.number === context.issue.number) {
25+
continue;
26+
}
27+
28+
if (issue.pull_request) {
29+
return; // Creator is already a contributor.
30+
}
31+
}
32+
33+
const body = `Hey ${creator}! Thanks for opening your first pull request in this repo. If you haven't already, make sure to read our [contribution guidelines](https://github.com/react-navigation/react-navigation/blob/main/CONTRIBUTING.md).`;
34+
35+
const comments = await github.issues.listComments({
36+
issue_number: context.issue.number,
37+
owner: context.repo.owner,
38+
repo: context.repo.repo,
39+
});
40+
41+
if (comments.data.some(comment => comment.body === body)) {
42+
return;
43+
}
44+
45+
await github.issues.createComment({
46+
issue_number: context.issue.number,
47+
owner: context.repo.owner,
48+
repo: context.repo.repo,
49+
body
50+
});
51+
52+
await github.issues.addLabels({
53+
issue_number: context.issue.number,
54+
owner: context.repo.owner,
55+
repo: context.repo.repo,
56+
labels: ['first pull request'],
57+
});

.github/workflows/rebase.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ jobs:
99
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- name: Checkout
13+
uses: actions/checkout@v2
1314
with:
1415
fetch-depth: 0
1516

0 commit comments

Comments
 (0)