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

feat: Add support for configurable REGISTRY_URL to download Databricks CLI from custom registrie #128

Open
wants to merge 2 commits into
base: main
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
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,21 @@ Alternatively, you can specify the version as a parameter to the action:
version: 0.221.1
```

### Using a Custom Registry (`REGISTRY_URL`)

You can also configure the action to download the Databricks CLI from a custom registry (e.g., an Artifactory or private mirror). This is helpful for environments where external resources like GitHub are restricted, or if you manage a private mirror.

To specify a custom registry, use the `registry_url` input:

```yml
- uses: databricks/setup-cli@main
with:
version: 0.221.1
registry_url: 'https://your-private-registry.com/artifactory'
```

In this example, the CLI will be downloaded from the specified `registry_url` instead of GitHub. If `registry_url` is not provided, it defaults to `https://github.com`.

## Preview notice

Please note that the Databricks CLI is in public preview as defined on
Expand Down
7 changes: 7 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ inputs:
description: '(snapshot build only) The branch to download the snapshot build for.'
required: false

registry_url:
description: 'The URL of the registry to download the Databricks CLI from (defaults to GitHub).'
required: false
default: 'https://github.com'

runs:
using: "composite"
steps:
Expand All @@ -26,13 +31,15 @@ runs:
env:
GH_REPO: databricks/cli
BRANCH: ${{ inputs.branch }}
REGISTRY_URL: ${{ inputs.registry_url }}

- name: Download release build
if: ${{ inputs.snapshot != 'true' }}
shell: bash
run: bash $GITHUB_ACTION_PATH/setup_release.sh
env:
VERSION: ${{ inputs.version }}
REGISTRY_URL: ${{ inputs.registry_url }}

- name: Get Databricks CLI version
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion setup_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ esac
cd "$RUNNER_TEMP"

# Download release archive.
curl -L -s -O "https://github.com/databricks/cli/releases/download/v${VERSION}/${FILE}.zip"
curl -L -s -O "${REGISTRY_URL}/databricks/cli/releases/download/v${VERSION}/${FILE}.zip"

# Unzip release archive.
unzip -q "${FILE}.zip" -d .bin
Expand Down