ci: make check-tree optional for branches other than main
Old branches tend to be formatted with a different versions of clang-format, so when patches are backported, they introduce some differences in formatting, making the check-tree job to fail.
These changes in formatting are normally small, and we don't pay much attention to them, causing that the pipelines are always red, increasing the work required to check if there are important failures or not.
Make check-tree optional for branches other than main. This way, failures will be shown as a "warning", and if a pipeline only shows a warning we don't need to inspect it.