Сhange the value of a security variable

Good afternoon.
As in GitLab CI change the value of a security variable inside .gitlab-ci.yml. Required to increment the value of the variable with each push

Runner from executor “shell” in Windows
In gitLab ci defined variable “BUILD_NUMBER” (Project->Settings->Variables -> Key “BUILD_NUMBER” and value “1”)


test_job:
stage: test
script:

  • echo %BUILD_NUMBER% #
  • set /A BUILD_NUMBER=%BUILD_NUMBER%+1
  • echo %BUILD_NUMBER%

    Output


echo %BUILD_NUMBER% 1 set /A BUILD_NUMBER=%BUILD_NUMBER%+1
$ echo %BUILD_NUMBER%
2

But in the Project-> Settings-> Variables value does not change

Sorry for my English. Thank you.

Hi proggertest,

Can you provide further information on the content of your .gitlab-ci.yml file? This will help us assist with your issue.

Thanks,
Chris

Runner from executor “shell” in Windows
In gitLab ci defined variable “BUILD_NUMBER” (Project->Settings->Variables -> Key “BUILD_NUMBER” and value “1”)


test_job:
stage: test
script:

  • echo %BUILD_NUMBER% #
  • set /A BUILD_NUMBER=%BUILD_NUMBER%+1
  • echo %BUILD_NUMBER%

    Output


echo %BUILD_NUMBER% 1 set /A BUILD_NUMBER=%BUILD_NUMBER%+1
$ echo %BUILD_NUMBER%
2

But in the Project-> Settings-> Variables value does not change