mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-03-26 09:14:22 +08:00
chore: only count repro from user's github repos
This commit is contained in:
18
.github/workflows/check-repro.yml
vendored
18
.github/workflows/check-repro.yml
vendored
@@ -13,12 +13,18 @@ jobs:
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const user = context.sender.login;
|
||||
const body = context.payload.comment
|
||||
? context.payload.comment.body
|
||||
: context.payload.issue.body
|
||||
: context.payload.issue.body;
|
||||
|
||||
if (!/https?:\/\/((github\.com\/[^/]+\/[^/]+\/?[\s\n]+)|(snack\.expo\.io\/.+))/gm.test(body)) {
|
||||
return
|
||||
const regex = new RegExp(
|
||||
`https?:\\/\\/((github\\.com\\/${user}\\/[^/]+\\/?[\\s\\n]+)|(snack\\.expo\\.io\\/.+))`,
|
||||
'gm'
|
||||
);
|
||||
|
||||
if (!regex.test(body)) {
|
||||
return;
|
||||
}
|
||||
|
||||
await github.issues.addLabels({
|
||||
@@ -26,7 +32,7 @@ jobs:
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
labels: ['repro provided'],
|
||||
})
|
||||
});
|
||||
|
||||
try {
|
||||
await github.issues.removeLabel({
|
||||
@@ -34,9 +40,9 @@ jobs:
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
name: 'needs repro',
|
||||
})
|
||||
});
|
||||
} catch (error) {
|
||||
if (!/Label does not exist/.test(error.message)) {
|
||||
throw error
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user