mirror of
				https://github.com/Swatinem/rust-cache.git
				synced 2025-10-31 23:03:48 +00:00 
			
		
		
		
	chore(dependabot): regenerate and commit dist/ (#257)
This commit is contained in:
		
							parent
							
								
									267a8a94c9
								
							
						
					
					
						commit
						d8c5063361
					
				
							
								
								
									
										38
									
								
								.github/workflows/dependabot.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										38
									
								
								.github/workflows/dependabot.yml
									
									
									
									
										vendored
									
									
								
							| @ -17,6 +17,44 @@ jobs: | |||||||
|         uses: dependabot/fetch-metadata@v2 |         uses: dependabot/fetch-metadata@v2 | ||||||
|         with: |         with: | ||||||
|           github-token: "${{ secrets.GITHUB_TOKEN }}" |           github-token: "${{ secrets.GITHUB_TOKEN }}" | ||||||
|  |       - uses: actions/checkout@v5 | ||||||
|  |         with:  | ||||||
|  |           fetch-depth: 2 | ||||||
|  |         if: steps.metadata.outputs.update-type == 'version-update:semver-patch' | ||||||
|  |       - name: Check if package-lock.json has been changed | ||||||
|  |         if: steps.metadata.outputs.update-type == 'version-update:semver-patch' | ||||||
|  |         id: npm | ||||||
|  |         env: | ||||||
|  |           PR_URL: ${{github.event.pull_request.html_url}} | ||||||
|  |           GH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||||||
|  |         run: | | ||||||
|  |           if ! git diff --quiet HEAD~1.. -- package-lock.json; then | ||||||
|  |             echo "changed=true" >> $GITHUB_OUTPUT | ||||||
|  |             echo "changed=true, checking out $PR_URL to allow amend" | ||||||
|  |             gh pr checkout "$PR_URL" | ||||||
|  |           fi | ||||||
|  |       - name: Setup node if necessary | ||||||
|  |         if: steps.npm.outputs.changed != '' | ||||||
|  |         uses: actions/setup-node@v4 | ||||||
|  |         with: | ||||||
|  |           node-version: 20.x | ||||||
|  |           cache: npm | ||||||
|  |       - name: Re-generate and commit dist/ if changed | ||||||
|  |         id: amend | ||||||
|  |         if: steps.npm.outputs.changed != '' | ||||||
|  |         run: | | ||||||
|  |           npm ci | ||||||
|  |           npm run prepare | ||||||
|  |           if ! git diff --quiet dist/*/index.js; then | ||||||
|  |             echo "dist/ changed, amending last commit" | ||||||
|  |             export $(git log -1 --pretty=format:'GIT_COMMITTER_NAME=%cn GIT_COMMITTER_EMAIL=%ce GIT_AUTHOR_NAME=%an GIT_AUTHOR_EMAIL=%ae') | ||||||
|  |             git fetch --unshallow | ||||||
|  |             echo "Before amend:" && git show --name-only --pretty= | ||||||
|  |             git commit --amend --no-edit --no-reset-author -- dist/*/index.js | ||||||
|  |             echo "After amend:" && git show --name-only --pretty= | ||||||
|  |             git push --force-with-lease origin HEAD | ||||||
|  |             echo "changed=true" >> $GITHUB_OUTPUT | ||||||
|  |           fi | ||||||
|       - name: Auto-merge Patch PRs |       - name: Auto-merge Patch PRs | ||||||
|         if: steps.metadata.outputs.update-type == 'version-update:semver-patch' |         if: steps.metadata.outputs.update-type == 'version-update:semver-patch' | ||||||
|         run: gh pr merge --auto --merge "$PR_URL" |         run: gh pr merge --auto --merge "$PR_URL" | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user