修复 renovate

Signed-off-by: 萌森 <qyg2297248353@163.com>
This commit is contained in:
萌森
2024-07-22 12:43:34 +08:00
parent 2fa4674686
commit a2d9b8988a
3 changed files with 84 additions and 10 deletions

View File

@@ -8,6 +8,7 @@ on:
manual-trigger:
description: 'Manually trigger Renovate'
default: ''
jobs:
update-app-version:
runs-on: ubuntu-latest
@@ -26,15 +27,16 @@ jobs:
id: updated-files
run: |
echo "::set-output name=files::$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | tr '\n' ' ')"
echo "Updated files: ${{ steps.updated-files.outputs.files }}"
- name: Run renovate-app-version.sh on updated files
run: |
IFS=' ' read -ra files <<< "${{ steps.updated-files.outputs.files }}"
for file in "${files[@]}"; do
if [[ $file == *"docker-compose.yml"* ]]; then
app_name=$(echo $file | cut -d'/' -f 2)
old_version=$(echo $file | cut -d'/' -f 3)
echo "Running script for app: $app_name, old version: $old_version"
chmod +x .github/workflows/renovate-app-version.sh
.github/workflows/renovate-app-version.sh $app_name $old_version
fi
@@ -43,11 +45,10 @@ jobs:
- name: Commit & Push Changes
run: |
IFS=' ' read -ra files <<< "${{ steps.updated-files.outputs.files }}"
for file in "${files[@]}"; do
if [[ $file == *"docker-compose.yml"* ]]; then
app_name=$(echo $file | cut -d'/' -f 2)
echo "Committing changes for app: $app_name"
git add "apps/$app_name/*" && git commit -m "Update app version [skip ci]" --no-verify && git push || true
fi
done