Skip to content

Commit

Permalink
Allow use of forks in case of origin so we generate preview-docs for …
Browse files Browse the repository at this point in the history
…JS too
  • Loading branch information
raulcd committed Sep 26, 2023
1 parent 1b7b52a commit e8ea90f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ci/scripts/js_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ yarn lint:ci
yarn build

if [ "${BUILD_DOCS_JS}" == "ON" ]; then
if [[ "$(git config --get remote.origin.url)" =~ "https://github.com/apache/arrow" ]]; then
yarn doc
# If apache or upstream are defined use those as remote.
# Otherwise use origin which could be a fork on PRs.
if [ "$(git config --get remote.apache.url)" == "[email protected]:apache/arrow.git" ]; then
yarn doc --gitRemote apache
elif [[ "$(git config --get remote.upstream.url)" =~ "https://github.com/apache/arrow" ]]; then
yarn doc --gitRemote upstream
elif [ "$(git config --get remote.apache.url)" == "[email protected]:apache/arrow.git" ]; then
yarn doc --gitRemote apache
elif [[ "$(basename -s .git $(git config --get remote.origin.url))" == "arrow" ]]; then
yarn doc
else
echo "Failed to build docs because the remote is not set correctly. Please set the origin or upstream remote to https://github.com/apache/arrow.git or the apache remote to [email protected]:apache/arrow.git."
exit 0
Expand Down

0 comments on commit e8ea90f

Please sign in to comment.