Skip to content

Commit 532117c

Browse files
authored
feat: allow overriding git server URL with GIT_SERVER_URL_OVERRIDE (#402)
1 parent 87b2657 commit 532117c

4 files changed

+7
-7
lines changed

bin/luarocks-tag-release-action.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ local repo_name = assert(
2323
]]
2424
)
2525

26-
local github_server_url = getenv_or_err('GITHUB_SERVER_URL')
26+
local git_server_url = os.getenv('GIT_SERVER_URL_OVERRIDE') or getenv_or_err('GITHUB_SERVER_URL')
2727

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

@@ -40,7 +40,7 @@ local test_interpreters = Parser.parse_interpreter_input(interpreters_input)
4040
local args = {
4141
github_repo = github_repo,
4242
repo_name = repo_name,
43-
github_server_url = github_server_url,
43+
git_server_url = git_server_url,
4444
dependencies = Parser.parse_list_args(getenv_or_empty('INPUT_DEPENDENCIES')),
4545
test_dependencies = Parser.parse_list_args(getenv_or_empty('INPUT_TEST_DEPENDENCIES')),
4646
labels = Parser.parse_list_args(getenv_or_empty('INPUT_LABELS')),

lua/ltr/rockspec.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ end
1313

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

57-
local repo_url = meta.github_server_url .. '/' .. meta.github_repo
57+
local repo_url = meta.git_server_url .. '/' .. meta.github_repo
5858
local homepage = repo_url
5959
local license = ''
6060
local repo_meta = meta.github_event_tbl

lua/luarocks-tag-release.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
---@class (exact) Args
77
---@field repo_name string The repository name.
88
---@field github_repo string The github repository (owner/repo_name).
9-
---@field github_server_url string The github server's URL.
9+
---@field git_server_url string The github server's URL.
1010
---@field git_ref string E.g. a tag or a commit sha.
1111
---@field ref_type github_ref_type
1212
---@field dependencies string[] List of LuaRocks package dependencies.
@@ -124,7 +124,7 @@ local function luarocks_tag_release(package_name, package_version, specrev, args
124124
local github_event_tbl = github_event_data and json.decode(github_event_data)
125125
local rockspec = require('ltr.rockspec').generate(package_name, modrev, specrev, rockspec_template, {
126126
ref_type = args.ref_type,
127-
github_server_url = args.github_server_url,
127+
git_server_url = args.git_server_url,
128128
github_repo = args.github_repo,
129129
license = args.license,
130130
git_ref = args.git_ref,

spec/rockspec_spec.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe('Rockspec', function()
4646
---@type GenerateMeta
4747
local meta = {
4848
ref_type = 'tag',
49-
github_server_url = 'https://github.com',
49+
git_server_url = 'https://github.com',
5050
github_repo = 'nvim-neorocks/luarocks-tag-release',
5151
git_ref = '1.0.0',
5252
summary = 'test summary',

0 commit comments

Comments
 (0)