Skip to content

Commit c87d03a

Browse files
hramosfacebook-github-bot
authored andcommitted
Update danger token
Summary: Closes #18111 Differential Revision: D7099636 Pulled By: hramos fbshipit-source-id: fc95ba83c34e0061c13fb831ea3496d7e8f3793a
1 parent b60a727 commit c87d03a

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

.circleci/config.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -547,15 +547,17 @@ jobs:
547547
- run:
548548
name: Analyze Pull Request
549549
command: |
550+
# DANGER_GITHUB_API_TOKEN=Facebook-Open-Source-Bot public_repo access token
550551
if [ -n "$CIRCLE_PR_NUMBER" ]; then
551-
cd bots && DANGER_GITHUB_API_TOKEN="e622517d9f1136ea8900""07c6373666312cdfaa69" yarn danger
552+
cd bots && DANGER_GITHUB_API_TOKEN="b186c9a82bab3b08ec80""c0818117619eec6f281a" yarn danger
552553
else
553554
echo "Skipping pull request analysis."
554555
fi
555556
when: always
556557
- run:
557558
name: Analyze Code
558559
command: |
560+
# GITHUB_TOKEN=eslint-bot public_repo access token
559561
if [ -n "$CIRCLE_PR_NUMBER" ]; then
560562
cat <(echo eslint; yarn --silent lint --format=json; echo flow; yarn --silent flow check --json) | GITHUB_TOKEN="af6ef0d15709bc91d""06a6217a5a826a226fb57b7" CI_USER=$CIRCLE_PROJECT_USERNAME CI_REPO=$CIRCLE_PROJECT_REPONAME PULL_REQUEST_NUMBER=$CIRCLE_PR_NUMBER node bots/code-analysis-bot.js
561563
else

bots/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ If you'd like to make changes to the Dangerfile, find an existing PR on the Reac
99
Then, run from the React Native root directory:
1010

1111
```
12-
cd .circleci
12+
cd bots
1313
npm install
1414
..
15-
node .circleci/node_modules/.bin/danger pr https://github.com/facebook/react-native/pull/1
15+
node bots/node_modules/.bin/danger pr https://github.com/facebook/react-native/pull/1
1616
```
1717

1818
And you will get the responses from parsing the Dangerfile.

bots/dangerfile.js

+2-12
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ if (!includesTestPlan) {
4545

4646
// Regex looks for given categories, types, a file/framework/component, and a message - broken into 4 capture groups
4747
const releaseNotesRegex = /\[(ANDROID|CLI|DOCS|GENERAL|INTERNAL|IOS|TVOS|WINDOWS)\]\s*?\[(BREAKING|BUGFIX|ENHANCEMENT|FEATURE|MINOR)\]\s*?\[(.*)\]\s*?\-\s*?(.*)/ig;
48-
const includesReleaseNotes = danger.github.pr.body.toLowerCase().includes('release notes');
48+
const includesReleaseNotes = danger.github.pr.body && danger.github.pr.body.toLowerCase().includes('release notes');
4949
const correctlyFormattedReleaseNotes = releaseNotesRegex.test(danger.github.pr.body);
5050
const releaseNotesCaptureGroups = releaseNotesRegex.exec(danger.github.pr.body);
5151

@@ -86,24 +86,14 @@ if (danger.github.pr.additions + danger.github.pr.deletions > bigPRThreshold) {
8686
warn(`${title} - <i>${idea}</i>`);
8787

8888
// markdown('@facebook-github-bot large-pr');
89-
}
90-
if (danger.git.modified_files + danger.git.added_files + danger.git.deleted_files > bigPRThreshold) {
89+
} else if (danger.git.modified_files + danger.git.added_files + danger.git.deleted_files > bigPRThreshold) {
9190
const title = ':exclamation: Big PR';
9291
const idea = `This PR is extremely unlikely to get reviewed because it touches ${danger.git.modified_files + danger.git.added_files + danger.git.deleted_files} files.`;
9392
warn(`${title} - <i>${idea}</i>`);
9493

9594
// markdown('@facebook-github-bot large-pr');
9695
}
9796

98-
// Warns if the bots whitelist file is updated.
99-
const issueCommandsFileModified = includes(danger.git.modified_files, 'bots/IssueCommands.txt');
100-
if (issueCommandsFileModified) {
101-
const title = ':exclamation: Bots';
102-
const idea = 'This PR appears to modify the list of people that may issue ' +
103-
'commands to the GitHub bot.';
104-
warn(`${title} - <i>${idea}</i>`);
105-
}
106-
10797
// Warns if the PR is opened against stable, as commits need to be cherry picked and tagged by a release maintainer.
10898
// Fails if the PR is opened against anything other than `master` or `-stable`.
10999
const isMergeRefMaster = danger.github.pr.base.ref === 'master';

0 commit comments

Comments
 (0)