Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #28: Add github.token as default credential #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
```
4 changes: 2 additions & 2 deletions action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
name: 'Deploy MkDocs'
description: 'Deploys MkDocs site'
author: 'Michael Hausenblas, [email protected]'
inputs:
auth_token:
description: 'Auth token used to API'
required: false
default: "${{ github.token }}
branding:
icon: 'arrow-up-circle'
color: 'orange'
Expand Down