Hello !
Is it normal that the job lib_common
never run ?
image: golang:1.18.3-alpine3.15
stages:
- prepare
- triggers
before_script:
- go install github.com/alexisvisco/gwd@v0.0.3
- apk add git
- git fetch origin main:main
triggers_rules:
stage: prepare
script:
- TRIGGER_LIBS_COMMON=$(gwd check libs/common -p main) # can be replaced with libs/common to test
- echo "TRIGGER_LIBS_COMMON is $TRIGGER_LIBS_COMMON"
- echo "TRIGGER_LIBS_COMMON=$APP_VERSION" >> triggers_rules.env
artifacts:
reports:
dotenv: triggers_rules.env
libs_common:
stage: triggers
# script:
# - echo $TRIGGER_LIBS_COMMON
trigger:
include: libs/common/.gitlab-ci.yml
strategy: depend
needs:
- job: triggers_rules
artifacts: true
rules:
- if: $TRIGGER_LIBS_COMMON == "libs/common"
when: always
Maybe I am wrong but I don’t think I can evaluate gwd check libs/common -p main
in the libs_common.rules[0].if
that’s why I created a job that produce an artifact with the env variable in it.
Do you have any idea on how to solve this problem ?