diff --git a/README.md b/README.md index 22d5179..971e2b4 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Note that this is an account-level token that has access to update **any** repo ### Building with `GITHUB_TOKEN` -This action supports building and deploying with a `GITHUB_TOKEN`. This token is automatically generated by Github Actions when a workflow runs so it is convenient. +This action supports building and deploying with a `GITHUB_TOKEN` as default. This token is automatically generated by Github Actions when a workflow runs so it is convenient. It is more **secure** than a personal token, since you never actually see the value of the `GITHUB_TOKEN` and also the `GITHUB_TOKEN` is scoped to only work for a **single** repo. @@ -57,8 +57,9 @@ jobs: uses: mhausenblas/mkdocs-deploy-gh-pages@master # Or use mhausenblas/mkdocs-deploy-gh-pages@nomaterial to build without the mkdocs-material theme env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CUSTOM_DOMAIN: optionaldomain.com CONFIG_FILE: folder/mkdocs.yml EXTRA_PACKAGES: build-base + with: + auth_token: ${{ secret.PERSONAL_TOKEN }} # Optional ``` diff --git a/action.sh b/action.sh index d96343e..f006b64 100644 --- a/action.sh +++ b/action.sh @@ -31,8 +31,8 @@ else export CONFIG_FILE="${GITHUB_WORKSPACE}/mkdocs.yml" fi -if [ -n "${GITHUB_TOKEN}" ]; then - print_info "setup with GITHUB_TOKEN" +if [ -n "${INPUT_AUTH_TOKEN}" ]; then + print_info "setup with INPUT_AUTH_TOKEN" remote_repo="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" elif [ -n "${PERSONAL_TOKEN}" ]; then print_info "setup with PERSONAL_TOKEN" diff --git a/action.yml b/action.yml index 44e4486..bb22a27 100644 --- a/action.yml +++ b/action.yml @@ -2,6 +2,11 @@ name: 'Deploy MkDocs' description: 'Deploys MkDocs site' author: 'Michael Hausenblas, hausenb@amazon.com' +inputs: + auth_token: + description: 'Auth token used to API' + required: false + default: "${{ github.token }} branding: icon: 'arrow-up-circle' color: 'orange'