I’m using a workflow where I create a PR, intentionally triggering CI & deploy preview, then I have a CI workflow that automatically creates and pushes a new commit to update screenshots if there’s a screenshot diff during a test.
Right now, I include [skip ci]
in that automatic commit to skip my other CI, but Netlify CI still gets triggered. The Deploy Preview is probably the most important to skip because I think it takes the longest, but there’s also Header Rules
, Pages Changed
, and Redirect Rules
- none of which are relevant for my automatically-made commit.
According to the docs, [skip ci]
in commit messages affects Netlify CI for branch and production builds, but not for PR builds. For PR builds, there’s the ability to add [skip ci]
to the PR title, but I want CI to run for the first commits in the PR, just not the automated ones added later.
In this previous topic https://answers.netlify.com/t/netlify-appears-to-be-ignoring-skip-ci-and-generating-the-deploy-preview-anyway , there was confusion about if the message needed to be in a specific commit - I would think that the commit triggering the build (HEAD?) would be the only one that matters. That topic resulted in clarification in the docs, but no changes were requested.
I think as long as you modify your PR title to include/exclude [skip ci]
any future commits should be skipped/built respectively. Outside of that, I currently don’t expect the behaviour to change any time soon, if at all. So the flow could look like:
- create a PR without
[skip ci]
in the title
- the PR would be deployed
- change title to add
[skip ci]
in the title
- continue pushing commits
Right, but the problem is that I just want to skip my automated commit. Most of the time, PRs result in feedback and changes after that, and those changes should trigger deploys. And those further changes could result in another automated commit (this automation updates screenshots if the previous commits affect e2e tests that use screenshots).
I would have to add [skip ci]
to the PR title each time after I make a commit, and remove it each time after the automated commit is added. I’m not going to manually do that. I suppose the best workaround would be to add two more GitHub Action steps to automatically edit the PR title before and after the automated commit. But then my PR will be littered with “PR title changed from X to Y” “PR title changed from Y to X”, and that creates more GitHub Action usage than necessary.
If changing this functionality isn’t a priority, I accept that, but this is not great for me.