From a3cf3ebd19bf8141c26429b4d0862e176bcda367 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Tue, 16 Sep 2025 16:30:32 +0300 Subject: [PATCH] Update patch-lua to support tags --- config.yaml | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/config.yaml b/config.yaml index f3f5b66..9e84c52 100644 --- a/config.yaml +++ b/config.yaml @@ -23,28 +23,23 @@ actions: -- If the branch/tag is AlmaLinux, then we need to get history of Upstream -- branch/tag, and skip all AlmaLinux-specific commits. To avoid duplicates -- in changelog and bumped release numbers - if have_git then - local log_branch = string.match(run_git('rev-parse --abbrev-ref HEAD'), '([^\n]+)') - if log_branch == 'HEAD' then - log_branch = string.match(run_git('describe --tags --exact-match'), '([^\n]+)') - local anum, aname = string.match(log_branch, '^changed/a(%d+s?)/(.+)$') - local cname = string.gsub(aname, '%.alma%.[0-9]+$', '') - 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 + local log_branch = string.match(run_git('rev-parse --abbrev-ref HEAD'), '([^\n]+)') + local anum = string.match(log_branch, '^a(%d+s?)$') + if anum then + log_branch = 'c' .. anum + else + log_branch = string.match(run_git('describe --tags --exact-match'), '([^\n]+)') + local anum, aname = string.match(log_branch, '^changed/a(%d+s?)/(.+)$') + if anum then + local cname = string.gsub(aname, '%.alma%.[0-9]+$', '') + log_branch = 'imports/c' .. anum .. '/' .. cname + end end count: 1 - target: "patch-git.lua" find: | commit_marker_contents = run_git('rev-parse HEAD') .. 'v' .. VERSION .. '\n' - replace: | commit_marker_contents = run_git('rev-parse ' .. log_branch) .. 'v' .. VERSION .. '\n'