-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Report size of app bundles on PRs (#28041)
Summary: Pull Request resolved: #28041 Report size of app bundles on PRs. See [React Native Benchmark Suite](react-native-community/discussions-and-proposals#186) for further discussion. ## Changelog [Internal] [Added] - Report size of app bundles on PRs Pull Request resolved: #28019 Test Plan: PRs should start seeing comments from a bot with app bundle sizes, given that they got built successfully. Reviewed By: cpojer Differential Revision: D19859187 Pulled By: hramos fbshipit-source-id: 3920dc60e6fd073928388e6ae52fc2ba1bc745ac
- Loading branch information
1 parent
619d5d6
commit 1b56292
Showing
5 changed files
with
293 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const {GITHUB_TOKEN, GITHUB_OWNER, GITHUB_REPO, GITHUB_PR_NUMBER} = process.env; | ||
if (!GITHUB_TOKEN || !GITHUB_OWNER || !GITHUB_REPO || !GITHUB_PR_NUMBER) { | ||
if (!GITHUB_TOKEN) { | ||
console.error( | ||
'Missing GITHUB_TOKEN. Example: 5fd88b964fa214c4be2b144dc5af5d486a2f8c1e. PR feedback cannot be provided on GitHub without a valid token.', | ||
); | ||
} | ||
if (!GITHUB_OWNER) { | ||
console.error('Missing GITHUB_OWNER. Example: facebook'); | ||
} | ||
if (!GITHUB_REPO) { | ||
console.error('Missing GITHUB_REPO. Example: react-native'); | ||
} | ||
if (!GITHUB_PR_NUMBER) { | ||
console.error( | ||
'Missing GITHUB_PR_NUMBER. Example: 4687. PR feedback cannot be provided on GitHub without a valid pull request number.', | ||
); | ||
} | ||
process.exit(1); | ||
} | ||
|
||
const {[2]: body} = process.argv; | ||
if (!body) { | ||
process.exit(0); | ||
} | ||
|
||
const octokit = require('@octokit/rest')(); | ||
octokit.authenticate({ | ||
type: 'oauth', | ||
token: GITHUB_TOKEN, | ||
}); | ||
octokit.issues.createComment({ | ||
owner: GITHUB_OWNER, | ||
repo: GITHUB_REPO, | ||
issue_number: GITHUB_PR_NUMBER, | ||
body, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,6 @@ | |
"minimatch": "^3.0.4" | ||
}, | ||
"dependencies": { | ||
"@octokit/rest": "15.18.0" | ||
"@octokit/rest": "^16.43.0" | ||
} | ||
} |
Oops, something went wrong.