40 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
name: Update app version in Renovate Branches
 | 
						|
 | 
						|
on:
 | 
						|
  push:
 | 
						|
    branches: [ 'renovate/*' ]
 | 
						|
    
 | 
						|
jobs:
 | 
						|
  update-app-version:
 | 
						|
    runs-on: ubuntu-latest
 | 
						|
    steps:
 | 
						|
      - name: Checkout
 | 
						|
        uses: actions/checkout@v3
 | 
						|
        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' ' ')"          
 | 
						|
 | 
						|
      - 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)
 | 
						|
              ./.github/workflows/renovate-app-version.sh $app_name
 | 
						|
            fi
 | 
						|
          done          
 | 
						|
      
 | 
						|
      - name: Commit & Push Changes
 | 
						|
        run: |
 | 
						|
          git add "apps/*/config.json" && git commit -m "Update app version" --no-verify && git push || true          
 |