mirror of
https://github.com/kenzok8/AutoSync.git
synced 2025-01-08 11:47:26 +08:00
update
This commit is contained in:
parent
cdbc30695e
commit
04e5b15c4e
7
.github/diy/test.sh
vendored
Executable file
7
.github/diy/test.sh
vendored
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 假设您的插件版本号可以通过执行命令来获取,例如 sing-box version
|
||||
PLUGIN_VERSION=$(${{ matrix.pakcages }} version | grep "$PKG_VERSION")
|
||||
|
||||
# 将版本号输出到标准输出
|
||||
echo "$PLUGIN_VERSION"
|
19
.github/workflows/litte.yml
vendored
19
.github/workflows/litte.yml
vendored
@ -51,14 +51,27 @@ jobs:
|
||||
bash /$GITHUB_WORKSPACE/.github/diy/create_acl_for_luci.sh -a
|
||||
bash /$GITHUB_WORKSPACE/.github/diy/Modify.sh
|
||||
|
||||
- name: Upload
|
||||
env:
|
||||
- name: Get Plugin Versions
|
||||
id: get_versions
|
||||
run: |
|
||||
cd $GITHUB_WORKSPACE/.github/diy/
|
||||
chmod +x test.sh
|
||||
PLUGIN_VERSION=$("./test.sh") # 执行脚本并获取输出
|
||||
echo "::set-output name=plugin_version::$PLUGIN_VERSION" # 将版本号设置为输出变量
|
||||
|
||||
- name: Check and Commit New Versions
|
||||
env:
|
||||
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
|
||||
run: |
|
||||
cd $GITHUB_WORKSPACE/${{matrix.target}}
|
||||
if git status --porcelain | grep .; then
|
||||
PLUGIN_VERSION="${{ steps.get_versions.outputs.plugin_version }}"
|
||||
|
||||
# 设置提交消息为自定义格式,包括插件版本号
|
||||
COMMIT_MESSAGE="${{matrix.target}}: update to $PLUGIN_VERSION"
|
||||
|
||||
git add .
|
||||
git commit -am "update $(date '+%Y-%m-%d %H:%M:%S')"
|
||||
git commit -m "$COMMIT_MESSAGE"
|
||||
git push --quiet "https://${{ secrets.ACCESS_TOKEN }}@github.com/kenzok8/litte.git" HEAD:${{matrix.target}}
|
||||
else
|
||||
echo "nothing to commit"
|
||||
|
Loading…
Reference in New Issue
Block a user