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 :
@@ -136,10 +134,10 @@ jobs:
136134 echo "</details>"
137135 echo "${delimiter}"
138136 } >> "$GITHUB_OUTPUT"
137+ # Run unconditionally so we can clear a stale comment when regressions are fixed.
139138 - name : Find Comment
140139 uses : peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0
141140 id : fc
142- if : steps.generate-diff-reports.outputs.reports != ''
143141 with :
144142 issue-number : ${{ steps.get-pull-request-number.outputs.pull_request_number }}
145143 comment-author : ' github-actions[bot]'
@@ -152,4 +150,16 @@ jobs:
152150 comment-id : ${{ steps.fc.outputs.comment-id }}
153151 issue-number : ${{ steps.get-pull-request-number.outputs.pull_request_number }}
154152 body : ${{ steps.generate-diff-reports.outputs.reports }}
153+ edit-mode : replace
154+
155+ # If a previous run posted a diff comment but this run has none, the regressions are fixed.
156+ - name : Mark previous regressions as resolved
157+ if : >
158+ steps.check-if-there-are-valid-files.outputs.exist_valid_files == 'false' &&
159+ steps.fc.outputs.comment-id != ''
160+ uses : peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
161+ with :
162+ comment-id : ${{ steps.fc.outputs.comment-id }}
163+ body : |
164+ Snapshot diff report: Previous regressions were resolved by the latest commit.
155165 edit-mode : replace
You can’t perform that action at this time.
0 commit comments