This workflow's automated logic works perfectly fine for when a repository has a charm, a rock, and(or) a Dockerfile that has to be always built and in some cases uploaded as an artefact or published, but we are working under the assumption that that's always the case. In some cases (see temporal-worker), where we have a rockcraft project that can be used as a guide/example, we definitely do not want to build and publish this image to any registry.
AFAICT (according to this guide), there is no option to prevent this from happening, but it would definitely be a great addition.