I have created an action on GitHub Enterprise that successfully runs the build on my self managed host. Next I need that build to be deployed to the same host but to do so I need the runner shell to have administrator permissions given that it’s updating IIS files etc. I can’t find a way to configure the runner or the action yaml to tell it I want the shell opened with administrator permissions though and as a result my deploy script fails (same script runs fine if I run it from the server myself in a cmd window with admin). How can I do this?
I strongly recommend against using a workflow to make changes to the runner machine in general. Instead you should use a suitable automation tool (for Linux servers I’d use Ansible, I don’t know what’s state of the art for Windows).
You can then call that automation tool from your workflow, and with appropriate credentials it’ll be able to make whatever changes are necessary. Note that this way it doesn’t matter which host runs your runner and which the server you deploy to.