diff --git a/.github/workflows/renovate-app-version.sh b/.github/workflows/renovate-app-version.sh index 495762e8f..4c396102a 100644 --- a/.github/workflows/renovate-app-version.sh +++ b/.github/workflows/renovate-app-version.sh @@ -28,6 +28,7 @@ do echo "将 apps/$app_name/$old_version 重命名为 apps/$app_name/$trimmed_version" if [ ! -d "apps/$app_name/$trimmed_version" ]; then mv apps/$app_name/$old_version apps/$app_name/$trimmed_version + echo "$trimmed_version" > apps/$app_name/${old_version}.version else echo "apps/$app_name/$trimmed_version 文件夹已存在" exit 1 diff --git a/.github/workflows/renovate-app-version.yml b/.github/workflows/renovate-app-version.yml index 98197deef..b576b4d78 100644 --- a/.github/workflows/renovate-app-version.yml +++ b/.github/workflows/renovate-app-version.yml @@ -27,7 +27,7 @@ jobs: - name: Get list of updated files by the last commit in this branch separated by space id: updated-files run: | - echo "::set-output name=files::$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | tr '\n' ' ')" + echo "files=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | tr '\n' ' ')" >> $GITHUB_OUTPUT - name: Run renovate-app-version.sh on updated files run: | @@ -49,6 +49,9 @@ jobs: for file in "${files[@]}"; do if [[ $file == *"docker-compose.yml"* ]]; then app_name=$(echo $file | cut -d'/' -f 2) - git add "apps/$app_name/*" && git commit -m "Update app version [skip ci]" --no-verify && git push || true + old_version=$(echo $file | cut -d'/' -f 3) + new_version=$(cat "apps/$app_name/${old_version}.version") + rm -f "apps/$app_name/${old_version}.version" + git add "apps/$app_name/*" && git commit -m "🔧 chore($app_name): update app version from $old_version to $new_version [skip ci]" --no-verify && git push || true fi done \ No newline at end of file diff --git a/renovate.json b/renovate.json index ce37bd4b0..af7ba4085 100644 --- a/renovate.json +++ b/renovate.json @@ -10,6 +10,7 @@ ], "automerge": true, "automergeType": "pr", + "automergeStrategy": "squash", "rebaseWhen": "never", "packageRules": [ {