Search code examples
gitlabgitlab-ci-runner

Deleting a branch using gitlab-ci.yml script


I am trying to delete a branch using gitlab-ci.yml. But it shows "you are not allowed to upload the script". I am using the script as in the image. Is there anything else that we need to do to delete the script using pipeline? enter image description here


Solution

  • In order to push any changes to your repo while you are using the pipeline, you cannot use the "git push origin --delete command directly. You have to use a similar way of local branch delete (git branch -d ) and push your code.

    Here is an example on how you can push the changes to GitLab repo from your pipeline - How do I push to a repo from within a gitlab CI pipeline?