Fix pre-commit rules
I'm proposing that we remove the restrictive !reference [.rules:disable-except-for-pushes-and-merge-requests]
ruleset from the pre-commit
job as it's blocking the use of either Branch-Pipelines.gitlab-ci.yml or MergeRequest-Pipelines.gitlab-ci.yml workflow templates.
With the changes proposed in this MR the pre-commit job is free to run on either branch or merge_request pipelines with the only restriction being that a .pre-commit-config.yaml
file must exist in the repo. This then means that users are completely free to decide what workflow to implement in their project. They can leave the default which will run duplicate pipelines when merge requests are open, or they can use workflow
rules to manage which pipeline types run. For projects using Auto-DevOps, we would strongly suggest including the Branch-Pipelines.gitlab-ci.yml template in the project's .gitlab-ci.yml
file to stop merge_request pipelines running at all seeing as Auto-DevOps templates do not support them.
One more note on the !reference [.rules:disable-except-for-pushes-and-merge-requests]
ruleset, this limits pipelines to only those with push
or merge_request
as the source. This actually has the adverse effect of not including the pre-commit
job when a pipeline is triggered via the web UI (by going to Build > Pipelines > Run Pipelines) as this requires the web
type. This can be confusing when running pipelines adhoc from the UI.
Closes #48 (closed)