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

Enable GHE #29

Merged
merged 3 commits into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Inputs:
* `app_version` Explicitly specify app version in package. If not defined then used chart values.
* `chart_version` Explicitly specify chart version in package. If not defined then used chart values.
* `index_dir` The location of `index.yaml` file in the repo, defaults to the same value as `target_dir`
* `enterprise_url` The URL of enterprise github server in the format `<server-url>/<organisation>`

## Examples

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ inputs:
index_dir:
description: "The location of `index.yaml` file in the repo, defaults to the same value as `target_dir`"
required: false
enterprise_url:
description: "The URL of enterprise github server in the format '<server-url>/<organisation>'"
required: false
runs:
using: 'docker'
image: 'Dockerfile'
Expand All @@ -67,3 +70,4 @@ runs:
- ${{ inputs.app_version }}
- ${{ inputs.chart_version }}
- ${{ inputs.index_dir }}
- ${{ inputs.enterprise_url }}
7 changes: 6 additions & 1 deletion src/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ COMMIT_EMAIL=${11}
APP_VERSION=${12}
CHART_VERSION=${13}
INDEX_DIR=${14}
ENTERPRISE_URL=${15}

CHARTS=()
CHARTS_TMP_DIR=$(mktemp -d)
Expand Down Expand Up @@ -71,7 +72,11 @@ main() {
fi

if [[ -z "$REPO_URL" ]]; then
REPO_URL="https://x-access-token:${GITHUB_TOKEN}@github.com/${OWNER}/${REPOSITORY}"
if [[ -z "$ENTERPRISE_URL" ]]; then
REPO_URL="https://x-access-token:${GITHUB_TOKEN}@github.com/${OWNER}/${REPOSITORY}"
else
REPO_URL="https://x-access-token:${GITHUB_TOKEN}@${ENTERPRISE_URL}/${REPOSITORY}"
fi
fi

if [[ -z "$COMMIT_USERNAME" ]]; then
Expand Down