diff --git a/README.md b/README.md index 56b6c5c..a9674ac 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,9 @@ jobs: repository_local: true # or... repository_url: https://github.com/lukaszraczylo/simple-gql-client + # when using remote repository, especially with private one: + github_username: lukaszraczylo + github_token: MySupeRSecr3tPa$$w0rd - name: Semver check run: | echo "Semantic version detected: ${{ steps.semver.outputs.semantic_version }}" diff --git a/action.yml b/action.yml index dd41bed..7713de9 100644 --- a/action.yml +++ b/action.yml @@ -16,6 +16,12 @@ inputs: repository_local: description: 'Use already cloned repository in current directory' required: false + github_token: + description: 'GitHub Personal Access Token OR password' + required: false + github_username: + description: 'GitHub or other git hosting provider username' + required: false outputs: semantic_version: description: 'Calculated semantic version' diff --git a/entrypoint.sh b/entrypoint.sh index 0830340..a3b4f77 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -26,6 +26,14 @@ if [[ "${FLAGS}" == "" && "$*" == "" ]]; then exit 1 fi +if [[ ! -z "$INPUT_GITHUB_TOKEN" ]]; then + export GITHUB_TOKEN=$INPUT_GITHUB_TOKEN +fi + +if [[ ! -z "$INPUT_GITHUB_USERNAME" ]]; then + export GITHUB_USERNAME=$INPUT_GITHUB_USERNAME +fi + cd /github/workspace OUT_SEMVER_GEN=$(/go/src/app/semver-gen generate $FLAGS $*) [ $? -eq 0 ] || exit 1