diff --git a/.github/workflows/update-branch.yml b/.github/workflows/update-branch.yml index 20aaa8d3ab..8f082e659e 100644 --- a/.github/workflows/update-branch.yml +++ b/.github/workflows/update-branch.yml @@ -49,7 +49,7 @@ jobs: git config user.email "raboneko@fyralabs.com" git config gpg.format "ssh" git config user.signingkey "${{ runner.temp }}/signing_key" - msg="bump(branch): $(git status | grep modified | sed -r 's@.+/([^/]+)/[^/]+\n?@\1 @g' | tr -d '\n')" + msg="bump(branch): $(anda run andax/ci/update_commit_message.rhai)" git commit -S -a -m "$msg" git push -u origin --all fi diff --git a/.github/workflows/update-nightly.yml b/.github/workflows/update-nightly.yml index 0ee9552bd3..091f36972b 100644 --- a/.github/workflows/update-nightly.yml +++ b/.github/workflows/update-nightly.yml @@ -37,7 +37,7 @@ jobs: git config user.email "raboneko@fyralabs.com" git config gpg.format "ssh" git config user.signingkey "${{ runner.temp }}/signing_key" - msg="bump(nightly): $(git status | grep modified | sed -r 's@.+/([^/]+)/[^/]+\n?@\1 @g' | tr -d '\n')" + msg="bump(nightly): $(anda run andax/ci/update_commit_message.rhai)" git commit -S -a -m "$msg" git format-patch HEAD^ copy_over () { diff --git a/.github/workflows/update-weekly.yml b/.github/workflows/update-weekly.yml index 075405b2e3..65edb49785 100644 --- a/.github/workflows/update-weekly.yml +++ b/.github/workflows/update-weekly.yml @@ -37,7 +37,7 @@ jobs: git config user.email "raboneko@fyralabs.com" git config gpg.format "ssh" git config user.signingkey "${{ runner.temp }}/signing_key" - msg="bump(weekly): $(git status | grep modified | sed -r 's@.+/([^/]+)/[^/]+\n?@\1 @g' | tr -d '\n')" + msg="bump(weekly): $(anda run andax/ci/update_commit_message.rhai)" git commit -S -a -m "$msg" git format-patch HEAD^ copy_over () { diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index d178a81ffe..60cdc844a5 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -37,7 +37,7 @@ jobs: git config user.email "raboneko@fyralabs.com" git config gpg.format "ssh" git config user.signingkey "${{ runner.temp }}/signing_key" - msg="bump: $(git status | grep modified | sed -r 's@.+/([^/]+)/[^/]+\n?@\1 @g' | tr -d '\n')" + msg="bump: $(anda run andax/ci/update_commit_message.rhai)" git commit -S -a -m "$msg" git format-patch HEAD^ copy_over () { diff --git a/andax/ci/update_commit_message.rhai b/andax/ci/update_commit_message.rhai new file mode 100644 index 0000000000..889800652c --- /dev/null +++ b/andax/ci/update_commit_message.rhai @@ -0,0 +1,13 @@ +import "anda::cfg" as cfg; + +let cmd = `git status | sed -nE '/^\tmodified:/{s@^\tmodified:\s+@@;s@[^/]+$@@;p}' | sort -u`; +let filelist = sh(cmd, #{ "stdout": "piped" }).ctx.stdout.split('\n'); + +let modified_list = ""; +for file in filelist { + if file.is_empty() { continue; } + let spec = cfg::load_file(`${file}/anda.hcl`).project.pkg.rpm.spec; + spec.pop(5); // remove `.spec` suffix + modified_list += `${spec} `; +} +print(modified_list[..modified_list.len()-1]);