message: Enable `warn-pr-from-master` on cross fork PRs
diff: @@ -4,15 +4,23 @@ import * as pageDetect from 'github-url-detection';
  import features from '.';
  import getDefaultBranch from '../github-helpers/get-default-branch';
  +import {getRepositoryInfo} from '../github-helpers';
  async function init(): Promise<false | void> {
  - const defaultBranch = await getDefaultBranch();
  + let defaultBranch;
  + if (select.exists('.is-cross-repo')) {
  + const forkedRepository = getRepositoryInfo(select('[title^="head: "]')!.textContent!);
  + defaultBranch = await getDefaultBranch(forkedRepository);
  + } else {
  + defaultBranch = await getDefaultBranch();
  + }
  +
  // Expected: /user/repo/compare/master...user:master
  if (!location.pathname.endsWith(':' + defaultBranch)) {
  return false;
  }
  - select('.gh-header-new-pr')!.append(
  + select('.js-compare-pr')!.before(
  <div className="flash flash-error my-3">
  <strong>Note:</strong> Creating a PR from the default branch is an <a href="https://blog.jasonmeridth.com/posts/do-not-issue-pull-requests-from-your-master-branch/" target="_blank" rel="noopener noreferrer">anti-pattern</a>.
  </div>
  @@ -27,5 +35,8 @@ void features.add({
  include: [
  pageDetect.isCompare
  ],
  + exclude: [
  + () => select.exists('.blankslate')
  + ],
  init
  });
  