Skip to content

Commit

Permalink
feat: allow overriding git server URL with GIT_SERVER_URL_OVERRIDE (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb authored Mar 27, 2024
1 parent 87b2657 commit 532117c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions bin/luarocks-tag-release-action.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ local repo_name = assert(
]]
)

local github_server_url = getenv_or_err('GITHUB_SERVER_URL')
local git_server_url = os.getenv('GIT_SERVER_URL_OVERRIDE') or getenv_or_err('GITHUB_SERVER_URL')

local is_pull_request = getenv_or_empty('GITHUB_EVENT_NAME') == 'pull_request'

Expand All @@ -40,7 +40,7 @@ local test_interpreters = Parser.parse_interpreter_input(interpreters_input)
local args = {
github_repo = github_repo,
repo_name = repo_name,
github_server_url = github_server_url,
git_server_url = git_server_url,
dependencies = Parser.parse_list_args(getenv_or_empty('INPUT_DEPENDENCIES')),
test_dependencies = Parser.parse_list_args(getenv_or_empty('INPUT_TEST_DEPENDENCIES')),
labels = Parser.parse_list_args(getenv_or_empty('INPUT_LABELS')),
Expand Down
4 changes: 2 additions & 2 deletions lua/ltr/rockspec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ end

---@class (exact) GenerateMeta
---@field ref_type github_ref_type
---@field github_server_url string The github server's URL.
---@field git_server_url string The github server's URL.
---@field github_repo string The github repository (owner/repo_name).
---@field license string|nil License SPDX ID (optional).
---@field git_ref string E.g. a tag or a commit sha.
Expand Down Expand Up @@ -54,7 +54,7 @@ function Rockspec.generate(package_name, modrev, specrev, rockspec_template, met
return '[[\n' .. table.concat(xs, '\n') .. ']]'
end

local repo_url = meta.github_server_url .. '/' .. meta.github_repo
local repo_url = meta.git_server_url .. '/' .. meta.github_repo
local homepage = repo_url
local license = ''
local repo_meta = meta.github_event_tbl
Expand Down
4 changes: 2 additions & 2 deletions lua/luarocks-tag-release.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
---@class (exact) Args
---@field repo_name string The repository name.
---@field github_repo string The github repository (owner/repo_name).
---@field github_server_url string The github server's URL.
---@field git_server_url string The github server's URL.
---@field git_ref string E.g. a tag or a commit sha.
---@field ref_type github_ref_type
---@field dependencies string[] List of LuaRocks package dependencies.
Expand Down Expand Up @@ -124,7 +124,7 @@ local function luarocks_tag_release(package_name, package_version, specrev, args
local github_event_tbl = github_event_data and json.decode(github_event_data)
local rockspec = require('ltr.rockspec').generate(package_name, modrev, specrev, rockspec_template, {
ref_type = args.ref_type,
github_server_url = args.github_server_url,
git_server_url = args.git_server_url,
github_repo = args.github_repo,
license = args.license,
git_ref = args.git_ref,
Expand Down
2 changes: 1 addition & 1 deletion spec/rockspec_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('Rockspec', function()
---@type GenerateMeta
local meta = {
ref_type = 'tag',
github_server_url = 'https://github.com',
git_server_url = 'https://github.com',
github_repo = 'nvim-neorocks/luarocks-tag-release',
git_ref = '1.0.0',
summary = 'test summary',
Expand Down

0 comments on commit 532117c

Please sign in to comment.