Config env-variables:
MR_PRIVATE_TOKEN
- token for connection to GitLab API with permission to create merge request.
You have to describe pipeline in .gitlab-ci.yml
. See example
The example based on Docker container which contains all necessary dependencies. So installation of them is skipped in it.
For the duties of example it added into stages tasts
. Usually it is quite good place.
Algorithm of script:
- Create name for new branch which will hold commited IDs on new issues. The branch name fits pattern "todo-registrar-".
- Check if previous MR is opened yet. Stop working when "yes".
- Run detection of not managed TODOs and creation of issues.
- Create new branch.
- Try to commit injected IDs of created issues.
- Push when something is commited.
- Create Merge Request.
The script presented in the example depends on additional bash-scripts:
- mr_check_existing.sh - check if opened MR exists from source depending on some patter to target branch.
- commit_and_push.sh - responsible for creating of new branch, configuring of author of commit, commiting and pushing of IDs of created issues.
- mr_create.sh - creates merge request.