问题
I have a job in my gitlab-ci.yml
like
build and push:
stage: push
only:
- master
script:
- gcloud docker -- push $IMAGE_TAG
The idea being that it should only run if the branch is master, but I also only want it to run if the repo is app/
and not dave/
The docs say
The repository path can be used to have jobs executed only for the parent repository and not forks:
job:
only:
- branches@gitlab-org/gitlab-ce
but I can't get this to work. If our gitlab server is gitlab.myco.io
and the app is app/my-project-name
I figured I could put
job:
only:
- branches@gitlab-myco-io/app/my-project-name/master
but that does not seem to work.
What is the correct way to do this?
回答1:
Try changing it to configuration below. You don't need it to run for all branches (only master branch) and that too of the original repo.
job:
only:
- master@app/my-project-name
来源:https://stackoverflow.com/questions/56070922/in-gitlabs-ci-cd-system-how-do-i-prevent-a-job-from-running-if-its-in-my-fork