mirror of
				https://hub.gitmirror.com/https://github.com/gradle/actions.git
				synced 2025-10-29 00:50:07 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			28 lines
		
	
	
		
			850 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			850 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
| name: Demo adding Build Scan® comment to PR
 | |
| on:
 | |
|   pull_request:
 | |
|     types: [assigned, review_requested]
 | |
| jobs:
 | |
|   gradle:
 | |
|     runs-on: ubuntu-latest
 | |
|     steps:
 | |
|     - name: Checkout project sources
 | |
|       uses: actions/checkout@v3
 | |
|     - name: Setup Gradle
 | |
|       uses: ./
 | |
|     - name: Run build with Gradle wrapper
 | |
|       id: gradle
 | |
|       working-directory: .github/workflow-samples/kotlin-dsl
 | |
|       run: ./gradlew build --scan
 | |
|     - name: "Add Build Scan URL as PR comment"
 | |
|       uses: actions/github-script@v6
 | |
|       with:
 | |
|         github-token: ${{secrets.GITHUB_TOKEN}}
 | |
|         script: |
 | |
|           github.rest.issues.createComment({
 | |
|             issue_number: context.issue.number,
 | |
|             owner: context.repo.owner,
 | |
|             repo: context.repo.repo,
 | |
|             body: 'PR ready for review: ${{ steps.gradle.outputs.build-scan-url }}'
 | |
|           })
 | 
