git-for-windows / git-for-windows-automation

A few GitHub workflows and support code to help with Git for Windows' day-to-day tasks
10 stars 9 forks source link

self-hosted runner: always use latest Git for Windows and GitHub Actions version (plus some PowerShell cleanups) #19

Closed rstolpe closed 1 year ago

rstolpe commented 1 year ago

GitHub git-windows and Action runner

Ensure that Action runner service was created Added so it will look if it has been created 3 times 3 seconds apart before it write error as sometime it can take time for the service to be created.

**Stop Service, actions.runner.***

Param

Error handling

Other

Got some more things that I can do later on when I have the time, I have tested it locally at the code should work but as I can't test with ActionRunner I'm advising you to test it also.

rstolpe commented 1 year ago

@dscho forget to req review on this one but when you have the time, take a look at it :)

rstolpe commented 1 year ago

@dscho i know I need to train on my comments on the commits. Same at work. I added some better ones for mistakes I was correcting

I wanted to use switch instead of bool but as I don't know how you execute the script I don't know if switch was good to use or not.

String for true or false is a big no ;) but I did revert it back

I'll adjust the script a little more during the end of next week I have some more adjustments that I want to add to make it even better.

Sorry that my last commits was unsigned I did not have any pgp cert for GitKraken but now I have fixed that too, thought it would use my ssl cert that vs and vscode are using.

dscho commented 1 year ago

Oh, you don't need to bother with GPG-signing... I was thinking more about giving context in the commit messages, intentions and additional information that's not obvious from reading the diff.

About using [bool]: if this works by providing the command-line parameter as a string, then by all means, let's use the correct data type.

dennisameling commented 1 year ago

I don't know how you execute the script I don't know if switch was good to use or not.

We use Microsoft's Azure Custom Script Extension for it. Here's how it's invoked. So I guess that something like this happens behind the scenes:

powershell -ExecutionPolicy Unrestricted -File C:\PATH_TO_SCRIPT\post-deployment-script.ps1 -GitHubActionsRunnerToken ABC123 -GithubActionsRunnerRegistrationUrl https://example.com -GithubActionsRunnerName ABC123 -StopService false -GitHubActionsRunnerPath D:\a

I'll test your changes on a fresh VM later today :) thanks for your work on this!

rstolpe commented 1 year ago

I don't know how you execute the script I don't know if switch was good to use or not.

We use Microsoft's Azure Custom Script Extension for it. Here's how it's invoked. So I guess that something like this happens behind the scenes:


powershell -ExecutionPolicy Unrestricted -File C:\PATH_TO_SCRIPT\post-deployment-script.ps1 -GitHubActionsRunnerToken ABC123 -GithubActionsRunnerRegistrationUrl https://example.com -GithubActionsRunnerName ABC123 -StopService false -GitHubActionsRunnerPath D:\a

I'll test your changes on a fresh VM later today :) thanks for your work on this!

I did return it to string but as it look of it I can improve it more now when I know how you execute it.

But test this things out first and after that I during next week improve it more :)

rstolpe commented 1 year ago

@dennisameling ill optimize it some more at the end of next week but until that I do think this will work for you.

It's nice to contribute to other projects.

Just DM me if you have some other things you want automated or similar :)

dennisameling commented 1 year ago

@dscho could you do a final review? I guess you'll want some more descriptive commit messages, right?

dscho commented 1 year ago

@dscho could you do a final review? I guess you'll want some more descriptive commit messages, right?

Maybe next time the commit messages could follow the Intent, Context, Implementation & Justification format.

But I don't want to hold up this contribution any further 😄