Skip to content

Commit

Permalink
Use cml to create/update PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed May 29, 2023
1 parent bf5c6f6 commit 4100205
Showing 1 changed file with 2 additions and 28 deletions.
30 changes: 2 additions & 28 deletions .github/workflows/dvc-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ jobs:
- name: Generate the image diff report
env:
repo_token: ${{ secrets.GITHUB_TOKEN }}
id: image-diff
run: |
echo -e "## Summary of changed images\n" > report.md
echo -e "This is an auto-generated report of images that have changed on the DVC remote\n" >> report.md
Expand Down Expand Up @@ -101,30 +100,5 @@ jobs:
# Mention git commit SHA in the report
echo -e "Report last updated at commit ${{ github.event.pull_request.head.sha }}" >> report.md
# Save the report content to the output parameter 'report'
echo 'report<<EOF' >> $GITHUB_OUTPUT
cat report.md >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Find comment with image diff report
uses: peter-evans/[email protected]
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: 'This is an auto-generated report of images that have changed on the DVC remote'

- name: Create comment with image diff report
if: steps.fc.outputs.comment-id == ''
uses: peter-evans/[email protected]
with:
issue-number: ${{ github.event.pull_request.number }}
body: ${{ steps.image-diff.outputs.report }}

- name: Update comment with new image diff report
if: steps.fc.outputs.comment-id != ''
uses: peter-evans/[email protected]
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
body: ${{ steps.image-diff.outputs.report }}
edit-mode: replace
# create/update PR comment
cml comment update

0 comments on commit 4100205

Please sign in to comment.