build_job:
stage: build
only:
- master # ✅ Runs on master branch
- tags # ✅ Runs when a tag is pushed
script:
# long and boring
artifacts:
paths:
- $BUILD_DIR/*
expire_in: 1 year
package_job:
stage: package
needs:
- build_job
only:
- tags
script:
When I push master the build_job only is executed - correct When I push tag only buld_job is not executed but package_job is executed (and failed of course) as it is incorrect
How can I execute build_job on master and tags but not other branches?
build_job:
stage: build
only:
- master # ✅ Runs on master branch
- tags # ✅ Runs when a tag is pushed
script:
# long and boring
artifacts:
paths:
- $BUILD_DIR/*
expire_in: 1 year
package_job:
stage: package
needs:
- build_job
only:
- tags
script:
When I push master the build_job only is executed - correct When I push tag only buld_job is not executed but package_job is executed (and failed of course) as it is incorrect
How can I execute build_job on master and tags but not other branches?
Share Improve this question edited yesterday bryanbcook 18.1k2 gold badges46 silver badges78 bronze badges asked yesterday 0___________0___________ 67.5k4 gold badges37 silver badges81 bronze badges1 Answer
Reset to default 0I was stupid and I was tagging the commit without it. Feel embarrassed