Support for Github Actions in Github Enterprise
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.
Sounds reasonable. I currently don't have access to a GitHub Enterprise instance to test, though. Maybe we can find a way to coordinate.
I am sure we can.
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.
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:
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
a95a239a6e8e448ab762for 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:
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
SUBSYSTEMnet.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 :/
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?