Expose git "push-option" flags to CI build

Problem to solve

Branch/tag based conditional logic in build execution is sometimes not sufficient or forces an artificial brancing/tagging to achieve build goals. push time flags would be very helpful. For example complete build pipeline includes deployment to a test server with lengthy web vulnerability scan. It is highly desired to be able to include/exclude steps like this dynamically when pushing a commit. Another example is to decide if I want an artifact be deployed to maven repository as a snapshot (1.1.3-SNAPSHOT) or numbered build (1.1.3-732) or not at all (just run the build but do not deploy)

For example, we currently use flag in commit message like [CI SNAPSHOT] or [CI DEPLOY] to trigger deployment

Now that gitlab supports use of "push-option" git flags for [CI SKIP] functionality it would be very useful if "push-option" flags were captured and exposed in CI build for use by CI build itself (conditional execution) or actual build systems like maven or gradle

Target audience

Developers

Further details

Proposal

What does success look like, and how can we measure that?

Links / references