Skip to content

Commit

Permalink
Merge pull request #55 from contentful/feat/support-app-token
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Add support for app tokens in auth
  • Loading branch information
andreascful authored Sep 13, 2022
2 parents 973f2eb + c8c89c6 commit a2e7a63
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions bin/publish-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ REPO_NAME=$1
NAMESPACE=$2
PAGES_DIR=./gh-pages
DOCS_DIR=./out
if [[ -z "${GH_TOKEN}" ]]; then # Check if GH_TOKEN is empty
TOKEN_GITHUB="${GITHUB_TOKEN}"
else
TOKEN_GITHUB="${GH_TOKEN}"
if [[ -n "${GITHUB_TOKEN}" ]]; then # If the GITHUB_TOKEN (which is an app token) is not empty we use an app token auth URL
REPO="https://x-access-token:${GITHUB_TOKEN}@github.com/contentful/${REPO_NAME}.git"
else # Legacy variant
REPO="https://${GH_TOKEN}@github.com/contentful/${REPO_NAME}.git"
fi
REPO="https://${TOKEN_GITHUB}@github.com/contentful/${REPO_NAME}.git"


VERSION=`cat package.json|json version`

echo "Publishing docs"
Expand Down

0 comments on commit a2e7a63

Please sign in to comment.