Add CI_ENVIRONMENT_ACTION to predefined environment variables

Release notes

Previously, it was not possible to expose the environment:action as a variable in a pipeline job. Now this is readily available as predefined CI/CD variables by using CI_ENVIRONMENT_ACTION.

https://docs.gitlab.com/ee/ci/variables/predefined_variables.html#variables-reference

Problem to solve

Problem Statement: Environment action is not programmatically available to the CI Job itself.

The environment action feature is extremely helpful to pre-stage environments before concluding with the actual deployment, but would be even more useful if jobs could utilize the value to make on-the-fly decisions.

For example: we have a script that only runs in a global before_script when it's a deployment (CI_ENVIRONMENT_NAME != null), but should not run when the deployment is only doing a pre-stage.

Proposal

Add CI_ENVIRONMENT_ACTION to predefined variables https://docs.gitlab.com/ee/ci/variables/predefined_variables.html#variables-reference

Links to related issues and merge requests / references

Edited by Thao Yeager