Gitlab-ci does not work

CI-Runner did not work when creating the .gitlab-ci.yml file by the following procedure.
Please let me know if you know the cause and how to deal with it.

I called a script using python-gitlab in git-hook (post-receive).
In the script, I created “.gitlab-ci.yml” with the code

project.files.create({'file_path': '.gitlab-ci.yml',
                      'branch': 'master',
                      'content': .......,
                      'commit_message': ......})

But shortly after that, CI-Runner was not executed

Originally .gitlab-ci.yml was created, so I think that CI-Runner will work …
By the way, pushing any file afterwards is working properly.