From 4583273ebe5cabfd1c14f647dc9edb7bff3c3bf3 Mon Sep 17 00:00:00 2001 From: Yuji Sato Date: Sat, 24 Sep 2022 05:20:33 +0900 Subject: [PATCH] feat: add Github Actions environment variable to isPullRequest method (#7152) --- .changeset/chilled-items-fail.md | 5 +++++ packages/builder-util/src/util.ts | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changeset/chilled-items-fail.md diff --git a/.changeset/chilled-items-fail.md b/.changeset/chilled-items-fail.md new file mode 100644 index 0000000000..b845d0188c --- /dev/null +++ b/.changeset/chilled-items-fail.md @@ -0,0 +1,5 @@ +--- +"builder-util": patch +--- + +feat: add Github Actions environment variable to isPullRequest method to detect if build is a PR diff --git a/packages/builder-util/src/util.ts b/packages/builder-util/src/util.ts index d14f42685d..fe8f98c449 100644 --- a/packages/builder-util/src/util.ts +++ b/packages/builder-util/src/util.ts @@ -327,7 +327,11 @@ export function isPullRequest() { } return ( - isSet(process.env.TRAVIS_PULL_REQUEST) || isSet(process.env.CIRCLE_PULL_REQUEST) || isSet(process.env.BITRISE_PULL_REQUEST) || isSet(process.env.APPVEYOR_PULL_REQUEST_NUMBER) + isSet(process.env.TRAVIS_PULL_REQUEST) || + isSet(process.env.CIRCLE_PULL_REQUEST) || + isSet(process.env.BITRISE_PULL_REQUEST) || + isSet(process.env.APPVEYOR_PULL_REQUEST_NUMBER) || + isSet(process.env.GITHUB_BASE_REF) ) }