Update patch-lua to support tags

This commit is contained in:
eabdullin 2025-09-16 16:30:32 +03:00
parent 5c0c36b092
commit 70b920ecb4

View File

@ -20,16 +20,24 @@ actions:
and posix.access(sourcedir .. '/.git/.', 'x'))) and posix.access(sourcedir .. '/.git/.', 'x')))
local commit_marker_contents -- For git_commit_file. local commit_marker_contents -- For git_commit_file.
-- If the branch is AlmaLinux branch, then we need to get history of Upstream -- If the branch/tag is AlmaLinux, then we need to get history of Upstream
-- branch, and skip all AlmaLinux-specific commits. To avoid duplicates -- branch/tag, and skip all AlmaLinux-specific commits. To avoid duplicates
-- in changelog and bumped release numbers -- in changelog and bumped release numbers
local branch = string.match(run_git('rev-parse --abbrev-ref HEAD'), '([^\n]+)') if have_git then
local log_branch = branch local log_branch = string.match(run_git('rev-parse --abbrev-ref HEAD'), '([^\n]+)')
local anum = string.match(branch, '^a(%d+)s$') if log_branch == 'HEAD' then
if anum then log_branch = string.match(run_git('describe --tags --exact-match'), '([^\n]+)')
log_branch = 'c' .. anum .. 's' local anum, aname = string.match(log_branch, '^changed/a(%d+s?)/(.+)$')
else local cname = string.gsub(aname, '%.alma%.[0-9]+$', '')
log_branch = 'HEAD' log_branch = 'imports/c' .. anum .. '/' .. cname
else
local anum = string.match(log_branch, '^a(%d+s?)$')
if anum then
log_branch = 'c' .. anum
else
log_branch = 'HEAD'
end
end
end end
count: 1 count: 1
- target: "patch-git.lua" - target: "patch-git.lua"