Skip to content

Commit

Permalink
Add configuration for update check to target a different repository (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
a-maze-d authored Aug 15, 2024
1 parent 400c29b commit cc97d8c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ config :livebook,
shutdown_callback: nil,
teams_auth?: false,
teams_url: "https://teams.livebook.dev",
github_release_repo: "livebook-dev/livebook",
update_instructions_url: nil,
within_iframe: false

Expand Down
7 changes: 7 additions & 0 deletions lib/livebook/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,13 @@ defmodule Livebook.Config do
"""
def app_version(), do: @app_version

@doc """
Returns the GitHub org/repo where the releases are created.
"""
def github_release_repo() do
Application.get_env(:livebook, :github_release_repo)
end

@doc """
Aborts booting due to a configuration error.
"""
Expand Down
2 changes: 1 addition & 1 deletion lib/livebook/update_check.ex
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ defmodule Livebook.UpdateCheck do
end

defp fetch_latest_version() do
url = "https://api.github.com/repos/livebook-dev/livebook/releases/latest"
url = "https://api.github.com/repos/#{Livebook.Config.github_release_repo()}/releases/latest"
headers = [{"accept", "application/vnd.github.v3+json"}]

case Livebook.Utils.HTTP.request(:get, url, headers: headers) do
Expand Down

0 comments on commit cc97d8c

Please sign in to comment.