Git Auto-Commit with Password

Has anyone been able to get the auto-commit on the designer to save working when the remote repo authentication requires a personal access token?

When I commit my changes through the command prompt, it asks me for my personal access token. I added the script to a bat file to be called on the Update script and my changes are not being pushed.

I suspect it is asking for a password and it’s not putting one so the commits aren’t making it to the remote repo.

Has anyone run into this problem?

The gateway doesn’t have any way to prompt you. And any script it calls (on the gateway) will be the user running the gateway service, not the user logged into the designer.

Not sure if your GW is windows or linux, but in Windows, you want to make sure you Ignition service is running under a specific account, not local system (should be a service account on your domain). They you can login to the server under that account and setup your git remote for SSH and configure the proper SSH keys rather than access tokens.

Once that is setup, any future commands executed by the Ignition Gateway will run under the service account and should authenticate to git without issues.

1 Like

I got this to work (partially) finally.
I know for sure my batch file is running when clicking save in the designer.
I made the batch file output text to a text file and that is happening.
Immediately after the write to the text file is the git commits.

The commits don’t happen though.
When I double-click the batch file the commits happen but from clicking save in the designer, they do not.

Here is the contents of the batch file
echo “test” > “C:\Program Files\Inductive Automation\test.txt”
cd “C:\Program Files\Inductive Automation\Ignition\data\projects”
set dateTime=%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2% %TIME:~0,2%:%TIME:~3,2%:%TIME:~6,2%
git add .
git commit -m “Designer save @ %dateTime%”
git push origin

any ideas what is wrong?

Did you follow Ryan’s instructions?

this is what i did

from the top radio button deleted to the ./user account.

When you run the batch file manually, is anything popping up for you to respond? If so, you’ll have to fix that. The service cannot interact with your desktop. (Use SSH keys as Ryan suggested.)

Yes I did that, just forgot to mention that on the previous comment. I did swap to ssh keys. Nothing is prompt for me to enter when running manually.

It looks like the commit is not working.
The files changed get staged.
I can see that they go from unstaged to staged from the command line.
As soon as the save button is clicked, I run git status and see that there are unstaged changes.
Then after 5 seconds, the files get staged.

The files never get committed for some reason.