Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Danger] Look at adding this repo as an upstream base #12229

Merged
merged 1 commit into from Feb 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 6 additions & 9 deletions dangerfile.js
Expand Up @@ -73,14 +73,6 @@ function setBoldness(row, isBold) {
}
}

/**
* Gets the commit that represents the merge between the current branch
* and master.
*/
function getMergeBase() {
return git('merge-base HEAD origin/master');
}

/**
* Gets the commit that represents the merge between the current branch
* and master.
Expand All @@ -100,7 +92,12 @@ function git(args) {
(async function() {
// Use git locally to grab the commit which represents the place
// where the branches differ
const mergeBaseCommit = await getMergeBase();
const upstreamRepo = danger.github.pr.base.repo.full_name;
const upstreamRef = danger.github.pr.base.ref;
await git(`remote add upstream https://github.com/${upstreamRepo}.git`);
await git('fetch upstream');
const mergeBaseCommit = await git(`merge-base HEAD upstream/${upstreamRef}`);

const commitURL = sha =>
`http://react.zpao.com/builds/master/_commits/${sha}/results.json`;
const response = await fetch(commitURL(mergeBaseCommit));
Expand Down