Gitlab doesn't recognize stop action for environment

Gitlab doesn’t recognize stop action for environment

I have CICD Config, which creates an environment. However, the on_stop action doesn’t properly get recognized by gittlab (selfhosted 14.9.2).

stages:
  - deploy

deploy_test:
  image: #myimage
  stage: deploy
  environment:
    name: test
    url: #myurl
    on_stop: stop_test
  rules:
    - if: '$CI_COMMIT_BRANCH == "mybranch" && $CI_PIPELINE_SOURCE != "merge_request_event"'
  script: #myscript


stop_test:
  stage: deploy
  variables:
    GIT_STRATEGY: none
  script: #myscript     
  when: manual
  environment:
    name: test
    action: stop

When I try to stop the environment via the GUI, it tells me that there is “no “stop environment action” being defined in the .gitlab-ci.yml file.”.

However, I can select stop_test as a possible “deployment target”:
Screenshot from 2022-04-07 20-00-50

Any ideas on what I’m doing wrong here?

Thanks!

I am having the same exact issue.

Did anyone find an answer for this? I am also having this issue. Thanks!