-
Notifications
You must be signed in to change notification settings - Fork 191
Position PowerShellForGitHub to be used in GitHub Actions? #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@TylerLeonhardt -- Sorry for the delayed response. I missed the notification when this came in. Thanks for the kudos in the module. Glad you're liking it. This idea certainly sounds intriguing. I'll admit that I have limited experience with GitHub Actions. I went through the training module they had when it was first released, but that was a while ago now. What do you propose as the next steps here? What work would need to be done to enable this to be used within Actions? |
I think the next steps would be: Improvements when running in Actions
Improvements for authoring Actions
What do you think @HowardWolosky? |
Interesting. In theory, all the support that is needed for that to happen already exists. $cred = New-Object System.Management.Automation.PSCredential "anything", ${{ secrets.GITHUB_TOKEN }}
Set-GitHubAuthentication -Credential $cred There's nothing that the module itself can do explicitly to better support this, because the user of the action still needs to expose |
True. I missed over the detail of it not being an env var... That'll be a bit more complicated with it needing to be a Set-GitHubAuthentication -Token ${{ secrets.GITHUB_TOKEN }} This would also work for PATs as well possibly... |
Whoops, you're right. I missed a step. Updated: $tokenEncrypted = ConvertTo-SecureString -String ${{ secrets.GITHUB_TOKEN }} -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential "anything", $tokenEncrypted
Set-GitHubAuthentication -Credential $cred Providing an authentication mechanism that works in plain text is generally frowned upon from a security standpoint. Every individual command in this module does let you explicitly pass in a plain text string for The second example in its usage was supposed to show how to do this very thing, but it had a mistake in it. I just submitted #173 to fix that example and add a reference to it in the documentation as well. Please, take a look. |
$PSDefaultParameterValues["*-GitHub*:AccessToken"] = "${{ secrets.GITHUB_TOKEN }}" That should do it too, I guess then. |
In any case I've updated #157 (comment) |
Indeed it would. I've added that note to the README as well as part of #173. |
Regarding the missing API support. We have full support for Issues, I'm almost done locally with full support for PR's (including PR reviews/comments). Releases should be pretty easy to complete soon too. Is there something within your list of action items that you're interested in working on? |
Maybe I'll try to work on:
I'll give it a go tomorrow. I might even try to hook in to Secret Management |
I have more clarity on this... really I want this ported to PowerShell: |
I wrote an action that provides a hydrated context like It also includes a module based on earlier versions of https://github.com./ebekker/pwsh-github-action-tools Maybe this helps someone or I can help here more. |
This module is by far the best PowerShell module out there for working with GitHub's API.
PowerShell is a fantastic language for CI/CD pipelines, automation pipelines, etc.
This makes PowerShell a great language to use in GitHub Actions.
My thinking is that PowerShellForGitHub could be leveraged as a GitHub Actions helper module that gives you PowerShell-y ways to interact with GitHub's APIs that are most likely touched in GitHub Actions:
etc.
And most important is to have a seamless way to authenticate the module from a running Action.
With this, we can say that PowerShell can be used for creating Actions - which is the ultimate goal.
This issue is more of a meta-discussion issue than anything else as I think some issues in this repo already call out the parts that are GH API gaps.
The text was updated successfully, but these errors were encountered: