How to use script in a Gitlab bridge job? I have a job which needs to include another job and needs to append a value to a variable, such as:
nightlies:
  variables:
    BUILD_NAME: &quot;nightly&quot;

  script:
    - $BUILD_NAME=&quot;${BUILD_NAME}-$(date +&quot;%Y%m%d&quot;)&quot;

  only:
    - schedules

  trigger:
    include:
      - local: /.gitlab-ci/build.yml
    strategy: depend

However reading the documentation script and trigger cannot be used together and I'm unsure of how else to create the BUILD_NAME with a date. Is there a way to use both. Otherwise, is there a way I could remove the trigger in order to use script, which would still call that job?
One option is to inherit your environment variable from another job. You can create two different jobs, one to create the environment variable, and one to trigger the local CI pipeline.
Once all that is done, you should have something like this:
stages:
  - build
  - deploy

nightlies_env:
  stage: build
  variables:
    BUILD_NAME: &quot;nightly&quot;
  script:
    - BUILD_NAME=&quot;${BUILD_NAME}-$(date +&quot;%Y%m%d&quot;)&quot;
    - echo &quot;BUILD_NAME=$BUILD_NAME&quot; &gt;&gt; build.env
  artifacts:
    reports:
      dotenv: build.env

nightlies:
  stage: deploy
  variables:
    BUILD_NAME: $BUILD_NAME
  trigger:
    include: build.yml
    strategy: depend