File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616# See the License for the specific language governing permissions and
1717# limitations under the License.
1818
19- # TODO: Handle the case where regressions are fixed
20-
2119name : " 🛠️ Screenshots: Comment"
2220
2321on :
@@ -138,10 +136,10 @@ jobs:
138136 echo "</details>"
139137 echo "${delimiter}"
140138 } >> "$GITHUB_OUTPUT"
139+ # Run unconditionally so we can clear a stale comment when regressions are fixed.
141140 - name : Find Comment
142141 uses : peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0
143142 id : fc
144- if : steps.generate-diff-reports.outputs.reports != ''
145143 with :
146144 issue-number : ${{ steps.get-pull-request-number.outputs.pull_request_number }}
147145 comment-author : ' github-actions[bot]'
@@ -154,4 +152,16 @@ jobs:
154152 comment-id : ${{ steps.fc.outputs.comment-id }}
155153 issue-number : ${{ steps.get-pull-request-number.outputs.pull_request_number }}
156154 body : ${{ steps.generate-diff-reports.outputs.reports }}
155+ edit-mode : replace
156+
157+ # If a previous run posted a diff comment but this run has none, the regressions are fixed.
158+ - name : Mark previous regressions as resolved
159+ if : >
160+ steps.check-if-there-are-valid-files.outputs.exist_valid_files == 'false' &&
161+ steps.fc.outputs.comment-id != ''
162+ uses : peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
163+ with :
164+ comment-id : ${{ steps.fc.outputs.comment-id }}
165+ body : |
166+ Snapshot diff report: Previous regressions were resolved by the latest commit.
157167 edit-mode : replace
You can’t perform that action at this time.
0 commit comments