ccmenu2 icon indicating copy to clipboard operation
ccmenu2 copied to clipboard

Support for Github Actions in Github Enterprise

Open rohte opened this issue 1 year ago • 6 comments

As Github Actions are supported, is it possible to support Github Actions on a Github Enterprise instance? I am just assuming that the APIs should be identical and that there is just a different server (with different credentials). It would require being able to store multiples of them, I guess.

rohte avatar Aug 08 '24 06:08 rohte

Sounds reasonable. I currently don't have access to a GitHub Enterprise instance to test, though. Maybe we can find a way to coordinate.

erikdoe avatar Aug 14 '24 22:08 erikdoe

I am sure we can.

rohte avatar Aug 15 '24 06:08 rohte

I've now made the GitHub client built into CCMenu more configurable. It's possible to set the URL's for the API and the main site as well as the client ID using the defaults system, e.g.

defaults write net.sourceforge.cruisecontrol.CCMenu GitHubAPIBaseURL "https://ghe.mycompany.com/api/v3"
defaults write net.sourceforge.cruisecontrol.CCMenu GitHubBaseURL "https://ghe.mycompany.com"
defaults write net.sourceforge.cruisecontrol.CCMenu GitHubClientID "a95a239a6e8e448ab762"

You need to do this before starting CCMenu, and, with a bit of luck, CCMenu will work for your GitHub Enterprise installation. However, it's also possible that it won't work. Some initial experiments have shown issues caused by reverse proxies.

Please, please, leave feedback here when things work or don't work. You can diagnose issues using the logging system built into macOS. Open Console.app, and filter for SUBSYSTEM net.sourceforge.cruisecontrol.CCMenu. If you go to Actions in the main menu of the console app and tick Include Debug Messages then you'll not only see errors but log entries for all requests made.

erikdoe avatar Dec 12 '24 23:12 erikdoe

Unfortunately it does not work. The was the only log entry

Request: GET https://git.my-company.com/users/myOrganisation/repos?per_page=100&type=all&sort=pushed

I ran the app from XCode. What I see in the UI is this: image

rohte avatar Dec 13 '24 08:12 rohte

I kind of got this working - it's definitely not a smooth experience though.

  • Create a OAuth app: https://ghe.mycompany.com/settings/developers
  • Set defaults as per:
defaults write net.sourceforge.cruisecontrol.CCMenu GitHubAPIBaseURL "https://ghe.mycompany.com/api/v3"
defaults write net.sourceforge.cruisecontrol.CCMenu GitHubBaseURL "https://ghe.mycompany.com"
defaults write net.sourceforge.cruisecontrol.CCMenu GitHubClientID "a95a239a6e8e448ab762"
  • Make sure to swap out a95a239a6e8e448ab762 for the ID of the app I just made
  • Manually make a pipeline JSON file to import:
[
  {
    "feedName" : "",
    "feedType" : "github",
    "feedUrl" : "https://ghe.mycompany.com/api/v3/repos/myorg/myrepo/actions/workflows/build.yaml/runs?branch=main",
    "name" : "My Repo - Build"
  },
  • Import it

The reason for having to manually import pipelines is due to this issue:

Image

Please, please, leave feedback here when things work or don't work. You can diagnose issues using the logging system built into macOS. Open Console.app, and filter for SUBSYSTEM net.sourceforge.cruisecontrol.CCMenu. If you go to Actions in the main menu of the console app and tick Include Debug Messages then you'll not only see errors but log entries for all requests made.

@erikdoe I tried to look for info in the console but I didn't see any output from the CCMenu process that wasn't a com.apple. subsystem

edit: I found the issue, the makeRequest function used in the flow overwrites the URL path and strips out the /api/v3 prefix, fixing that to an append operation makes it work. Happy to PR a fix as long as appending doesn't break anything?

edit: doesn't seem to quite work - the add form fully works apart from clicking apply doesn't seem to do anything and I don't see any obvious issues in the Xcode console :/

j-mie avatar Jun 03 '25 04:06 j-mie

Finally got round to looking into this. I must admit that it seems I broke the logging. (I changed the level to "trace" and that doesn't seem to get shown in the Console app under any circumstace.) Apologies.

That said, I have now fixed the path overwriting bug, and the fix is included in the first pre-release for CCMenu 28.0 here: https://github.com/ccmenu/ccmenu2/releases/tag/v28.0d1

Can you try again?

erikdoe avatar Jul 19 '25 08:07 erikdoe