mirror of
https://github.com/QYG2297248353/appstore-1panel.git
synced 2024-11-25 03:18:48 +08:00
55 lines
2.0 KiB
YAML
55 lines
2.0 KiB
YAML
name: Update app version in Renovate Branches
|
|
|
|
on:
|
|
push:
|
|
branches: [ 'renovate/*' ]
|
|
workflow_dispatch:
|
|
inputs:
|
|
manual-trigger:
|
|
description: 'Manually trigger Renovate'
|
|
default: ''
|
|
|
|
jobs:
|
|
update-app-version:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Configure repo
|
|
run: |
|
|
git config --local user.email "githubaction@githubaction.com"
|
|
git config --local user.name "github-action update-app-version"
|
|
|
|
- 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 "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
|
|
done
|
|
|
|
- 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
|