Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » GitClone tasks and GitHub tokens(How to support github personal access tokens in GitClone tasks?)
GitClone tasks and GitHub tokens [message #1850579] Tue, 08 March 2022 21:36 Go to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
I'm creating a setup model that clones some github repositories but I'm having trouble dealing with GitHub's personal access tokens (PAT).

My first approach was to use the defaults when I create a GitClone with an InducedChoices element that specifies inherit -> github.remoteURIs and target -> remoteURI, but when I run it it fails cloning it.

So my second approach was to remove the InducedChoices and replace the RemoteURI of the GitClone task with

https://${github.user.id|username}:${github.token}@github.com/myorg/myrepo.git


where I added a variable ${github.token} of type PASSWORD.

But when I run this it also fails, and in particular I see that it seems to be replacing the ${github.token} variable with the encrypted password.

So, how can you create a GitClone task that works with PATs?

I haven't found any documentation about it.

Thanks.

Re: GitClone tasks and GitHub tokens [message #1850588 is a reply to message #1850579] Wed, 09 March 2022 08:55 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33145
Registered: July 2009
Senior Member
Why not avoid the whole mess and use an ssh key? I would expect EGit to prompt for your "password" though actually only your personal access token will work for that purpose in response to the prompt. Have you tried to figure out what actually works manually?

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: GitClone tasks and GitHub tokens [message #1850602 is a reply to message #1850588] Wed, 09 March 2022 16:32 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
Hi,

Well, I'm not entirely sure what works manually, but I tried again the original tasks with the induced choices without the github.token variable and strangely this time it worked. And weirdly, EGit didn't ask me for the password. I assume I had previously entered it and it was stored in the secure storage. I'm not sure why it failed before. I think I may have chosen the wrong protocol for the git repo in the Oomph wizard (git instead of https). Or maybe the wind was blowing in a different direction. Unfortunately I deleted the installations and its setup log so I don't know for sure. But alas, seems to be working now.

By the way, is there any documentation about the different "built-in" tasks other than their javadoc API? I thought I once saw some documentation like that somewhere but I cannot find it.

Thanks


Re: GitClone tasks and GitHub tokens [message #1850613 is a reply to message #1850602] Thu, 10 March 2022 06:42 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33145
Registered: July 2009
Senior Member
Sorry, no, there is no comprehensive documentation other than the wiki:

https://wiki.eclipse.org/Eclipse_Oomph_Authoring


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Setting custom default Eclipse perspective
Next Topic:Setup tasks for preferences
Goto Forum:
  


Current Time: Tue May 07 15:33:12 GMT 2024

Powered by FUDForum. Page generated in 0.04405 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top