In a conversation with @yaRnMcDonuts we discussed having a bot automatically post a message when the screenshot tests fail to explain what is going on and what to do about it. I’ve now got that working
It only posts this comment once so it won’t flood the PR with annoying comments if someone spends several commits trying to fix the tests
Security
So github is weirdly unhappy with giving randos from the internet write permission to repos. Who knew! That means in the context of an on:pull_request:
pipeline the token has read only permissions. But what I’ve done is created a separate workflow that runs on:pull_request_target:
. This workflow does have write permission but runs on the original (pre PR) code. This means it’s nice and secure. This second pipeline watches the first and issues the comment only if the first one fails.
It is hard for me to know for sure this will work till it is merged but based on everything I’ve read it should.
Pull request
(That includes this change and that I’m hoping to get merged)