mirror of
				https://github.com/bartvdbraak/omnidash.git
				synced 2025-10-31 00:19:12 +00:00 
			
		
		
		
	fix: Deprecated set-output changes and GitHub Rest
This commit is contained in:
		
							parent
							
								
									984b4e49f0
								
							
						
					
					
						commit
						a41ae0e580
					
				
					 1 changed files with 15 additions and 13 deletions
				
			
		
							
								
								
									
										28
									
								
								.github/workflows/seo-reports.yaml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										28
									
								
								.github/workflows/seo-reports.yaml
									
										
									
									
										vendored
									
									
								
							|  | @ -63,29 +63,31 @@ jobs: | ||||||
|         id: calculate-score |         id: calculate-score | ||||||
|         run: | |         run: | | ||||||
|           average=$(jq -r '[.[] | .score] | add / length' ./.unlighthouse/ci-result.json) |           average=$(jq -r '[.[] | .score] | add / length' ./.unlighthouse/ci-result.json) | ||||||
|           echo "::set-output name=average_score::$average" |           echo "average_score=${average}" >> "$GITHUB_OUTPUT" | ||||||
| 
 | 
 | ||||||
|       - name: Create Markdown Table |       - name: Create Markdown Table | ||||||
|         id: create-table |         id: create-table | ||||||
|  |         env: | ||||||
|  |           md_file_path: './.unlighthouse/table.md' | ||||||
|         run: | |         run: | | ||||||
|           echo "## Unlighthouse Results" > ./.unlighthouse/table.md |           echo "## Unlighthouse Results" > $md_file_path | ||||||
|           echo "" >> ./.unlighthouse/table.md |           echo "" >> $md_file_path | ||||||
|           echo "Overall score: **${{ steps.calculate-score.outputs.average_score }}**" >> ./.unlighthouse/table.md |           echo "Overall score: **${{ steps.calculate-score.outputs.average_score }}**" >> $md_file_path | ||||||
|           echo "" >> ./.unlighthouse/table.md |           echo "" >> $md_file_path | ||||||
|           echo "Path | Score" >> ./.unlighthouse/table.md |           echo "Path | Score" >> $md_file_path | ||||||
|           echo "-----|------" >> ./.unlighthouse/table.md |           echo "-----|------" >> $md_file_path | ||||||
|           cat ./.unlighthouse/ci-result.json | jq -r '.[] | [.path, .score] | @tsv' | sed 's/\t/ | /g' >> ./.unlighthouse/table.md |           cat ./.unlighthouse/ci-result.json | jq -r '.[] | [.path, .score] | @tsv' | sed 's/\t/ | /g' >> $md_file_path | ||||||
|           echo "" >> ./.unlighthouse/table.md |           echo "" >> $md_file_path | ||||||
|           echo "[View the full report](https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ steps.git-branch.outputs.SOURCE_REF }})" >> ./.unlighthouse/table.md |           echo "[View the full report](https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ steps.git-branch.outputs.SOURCE_REF }})" >> $md_file_path | ||||||
|           echo "::set-output name=table_path::.unlighthouse/table.md" |           echo "md_file_path=${md_file_path}" >> "$GITHUB_OUTPUT" | ||||||
| 
 | 
 | ||||||
|       - name: Comment on Pull Request |       - name: Comment on Pull Request | ||||||
|         uses: actions/github-script@v6 |         uses: actions/github-script@v6 | ||||||
|         with: |         with: | ||||||
|           script: | |           script: | | ||||||
|             const fs = require('fs'); |             const fs = require('fs'); | ||||||
|             const tablePath = fs.readFileSync('${{ steps.create-table.outputs.table_path }}', 'utf8'); |             const tablePath = fs.readFileSync('${{ steps.create-table.outputs.md_file_path }}', 'utf8'); | ||||||
|             github.issues.createComment({ |             github.rest.issues.createComment({ | ||||||
|               issue_number: context.issue.number, |               issue_number: context.issue.number, | ||||||
|               owner: context.repo.owner, |               owner: context.repo.owner, | ||||||
|               repo: context.repo.repo, |               repo: context.repo.repo, | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue