only/except tags unexpected behavior with extends
It's somewhat surprising that when using extends
, only: - tags
and except: - tags
will be merged, and the result is that a tag job will be lost:
build:
variables:
BUILD_TYPE: "Build only"
script:
- echo $BUILD_TYPE
except:
- tags
build and push:
extends: build
variables:
BUILD_TYPE: "Build and push"
only:
- tags
Workaround:
build:
variables:
BUILD_TYPE: "Build only"
script:
- echo $BUILD_TYPE
except:
- tags
build and push:
extends: build
variables:
BUILD_TYPE: "Build and push"
only:
- tags
except: # override <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<