Pipeline automatically starts all over after all the stages complete

My pipeline automatically starts after all the stages complete

I’ve ran into this weird issue where the whole pipeline would start again after it completes all the stages. Basically I’m building my project and release the build binary.

I’ve three stages build, upload and release. All of these are being ran and build without any issues, it’s just that after all the stages complete it starts over again. I’m completely new to using CI/CD so any help would be great.

My .yml file is:

stages:
  - build
  - upload
  - release

variables:
  PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/release/${PACKAGE_VERSION}"

build:
  stage: build
  image: espressif/idf:latest
  script:
    - idf.py set-target esp32
    - idf.py build
  artifacts:
    paths:
      - build/hello_world.bin

upload:
  stage: upload
  image: curlimages/curl:latest
  script:
    - |
      curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file build/hello_world.bin "${PACKAGE_REGISTRY_URL}/hello_world.bin"

release-branch:
  stage: release
  image: registry.gitlab.com/gitlab-org/release-cli:latest
  script:
    - |
      release-cli create --name release-branch-$CI_JOB_ID --tag-name job-$CI_JOB_ID \
        --assets-link "{\"name\":\"hello_world.bin\",\"url\":\"${PACKAGE_REGISTRY_URL}/hello_world.bin\"}"

I tried uploading an image but it’s showing and error.

I’ve tried debugging it but only having echo commands in scripts and not using any images, it’s working as usual and not creating a new pipeline.

Thanks.


After running each task individually, It’s only the last task that causing the issue.