mirror of
				https://github.com/community-scripts/ProxmoxVE.git
				synced 2025-11-04 10:22:50 +00:00 
			
		
		
		
	Verify changes before commit in changelog-pr.yml (#310)
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							d4ae7a9af0
						
					
				
				
					commit
					b9e84543fc
				
			
							
								
								
									
										21
									
								
								.github/workflows/changelog-pr.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										21
									
								
								.github/workflows/changelog-pr.yml
									
									
									
									
										vendored
									
									
								
							@@ -37,19 +37,6 @@ jobs:
 | 
				
			|||||||
            echo "LATEST_DATE=$LATEST_DATE" >> $GITHUB_ENV
 | 
					            echo "LATEST_DATE=$LATEST_DATE" >> $GITHUB_ENV
 | 
				
			||||||
          fi
 | 
					          fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Check if CHANGELOG.md was modified
 | 
					 | 
				
			||||||
        id: changelog-check
 | 
					 | 
				
			||||||
        run: |
 | 
					 | 
				
			||||||
          CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
 | 
					 | 
				
			||||||
          echo "Changed files: $CHANGED_FILES"
 | 
					 | 
				
			||||||
          if echo "$CHANGED_FILES" | grep -q 'CHANGELOG.md'; then
 | 
					 | 
				
			||||||
            echo "Changes detected in CHANGELOG.md, skipping additional checks."
 | 
					 | 
				
			||||||
            echo "changelog_modified=true" >> $GITHUB_ENV
 | 
					 | 
				
			||||||
          else
 | 
					 | 
				
			||||||
            echo "No changes to CHANGELOG.md, continuing with protection checks."
 | 
					 | 
				
			||||||
            echo "changelog_modified=false" >> $GITHUB_ENV
 | 
					 | 
				
			||||||
          fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      - name: Get categorized pull requests
 | 
					      - name: Get categorized pull requests
 | 
				
			||||||
        id: get-categorized-prs
 | 
					        id: get-categorized-prs
 | 
				
			||||||
        uses: actions/github-script@v7
 | 
					        uses: actions/github-script@v7
 | 
				
			||||||
@@ -123,9 +110,14 @@ jobs:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            const newChangelogContent = changelogContent.replace(regex, newReleaseNotes)
 | 
					            const newChangelogContent = changelogContent.replace(regex, newReleaseNotes)
 | 
				
			||||||
            await fs.writeFile(changelogPath, newChangelogContent);
 | 
					            await fs.writeFile(changelogPath, newChangelogContent);
 | 
				
			||||||
            
 | 
					
 | 
				
			||||||
 | 
					      - name: Check if there are any changes
 | 
				
			||||||
 | 
					        id: verify-diff
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Commit and push changes to separate branch
 | 
					      - name: Commit and push changes to separate branch
 | 
				
			||||||
 | 
					        if: steps.verify-diff.outputs.changed == 'true'
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          git config --global user.name "github-actions[bot]"
 | 
					          git config --global user.name "github-actions[bot]"
 | 
				
			||||||
          git config --global user.email "github-actions[bot]@users.noreply.github.com"
 | 
					          git config --global user.email "github-actions[bot]@users.noreply.github.com"
 | 
				
			||||||
@@ -135,6 +127,7 @@ jobs:
 | 
				
			|||||||
          git push origin $BRANCH_NAME --force
 | 
					          git push origin $BRANCH_NAME --force
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Create pull request if not exists
 | 
					      - name: Create pull request if not exists
 | 
				
			||||||
 | 
					        if: steps.verify-diff.outputs.changed == 'true'
 | 
				
			||||||
        env:
 | 
					        env:
 | 
				
			||||||
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 | 
					          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user