feat(ci): better autoupdate commit messages (#4720)

* feat(ci): better autoupdate commit messages

* fix: also sort
This commit is contained in:
madomado
2025-05-07 18:34:27 +08:00
committed by GitHub
parent 6509b88103
commit 7de992923b
5 changed files with 17 additions and 4 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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 () {
+1 -1
View File
@@ -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 () {
+1 -1
View File
@@ -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 () {
+13
View File
@@ -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]);