OblikStudio / kirby-git

Kirby plugin for updating content in the panel via Git
MIT License
84 stars 6 forks source link

Problems to use the API for push in a Hook #11

Closed janstieler closed 3 years ago

janstieler commented 3 years ago

HI, I try to use $git->push()in a hook.

'hook' => [
        'page.*:after' => function($newPage, $oldPage){
            $git = new Git();

            $git->add();
            $git->commit('update from ' . $oldPage->uid() . ' to ' . $newPage->uid());
            $git->push();
        },
]

if I try to save a page I got this message:

The Form could not saved because

Exception: undefined
Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

If i comment $git->push() out, the commitment works without error. But I lost the push.

Have you an Idea whats going on?

Cheers

janstieler commented 3 years ago

Hi, It was a problem with my key passphrase. Sorry for that disturbance :) .