File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4949 env :
5050 repo_token : ${{ secrets.GITHUB_TOKEN }}
5151 run : |
52+ # Summary of changed images
5253 echo -e "## Summary of changed images\n" > report.md
5354 echo -e "This is an auto-generated report of images that have changed on the DVC remote\n" >> report.md
5455 dvc diff --show-md main HEAD >> report.md
56+
57+ # Get just the filename of the added and modified image from the report
58+ awk 'NF==5 && NR>=7 && $2=="added" {print $4}' report.md > added_files.txt
59+ awk 'NF==5 && NR>=7 && $2=="modified" {print $4}' report.md > modified_files.txt
60+
61+ # Append each image to the markdown report
62+ echo -e "## Image diff(s)\n" >> report.md
63+ echo -e "<details>\n" >> report.md
64+
65+ # Added images
66+ echo -e "### Added images\n" >> report.md
67+ while IFS= read -r line; do
68+ echo -e "- $line \n" >> report.md
69+ echo -e "" >> report.md
70+ done < added_files.txt
71+
72+ echo -e "</details>\n" >> report.md
73+
74+ # Mention git commit SHA in the report
75+ echo -e "Report last updated at commit ${{ github.event.pull_request.head.sha }}" >> report.md
76+
77+ # create/update the PR comment
5578 cml comment update report.md
5679
5780 - name : Generate the image diff report
You can’t perform that action at this time.
0 commit comments