Skip to content

Commit 1556473

Browse files
Update README clarifying the supported platforms (#118)
## Description - Update `README` clarifying the supported platforms. - Add a test for `Invoke-GitHubAPI` ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent 56de52f commit 1556473

File tree

2 files changed

+29
-46
lines changed

2 files changed

+29
-46
lines changed

README.md

Lines changed: 16 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
# GitHub PowerShell
22

3-
The **GitHub PowerShell** module serves as a convenient API wrapper around [GitHub's REST API](https://docs.github.com/en/rest), making the functionalities and data available on GitHub accessible through PowerShell commands. This module is tailored for developers, administrators, and GitHub enthusiasts who are familiar with PowerShell and want to integrate or manage their GitHub repositories seamlessly.
3+
The module serves as a wrapper around [GitHub's REST API](https://docs.github.com/en/rest), making the functionalities and data available on GitHub
4+
accessible through PowerShell functions and classes. This module is tailored for developers, administrators, and GitHub enthusiasts who are familiar
5+
with PowerShell and want to integrate or manage GitHub seamlessly.
46

5-
**GitHub PowerShell** is built with the community in mind and targets individuals who prefer script-based solutions and want to automate various tasks on GitHub without resorting to a full-fledged development approach.
7+
## Desired supported scenarios
68

7-
## Features & Benefits of GitHub PowerShell
9+
- Support operators of personal repos, organization repos, and enterprise repos. -> Similar to the GitHub CLI, but with more commands.
10+
- Help operators that have multiple account and is a member of multiple organizations/enterprises. -> Similar to the GitHub CLI.
11+
- A context aware module that knows what environment you are working in, both locally and in GitHub Actions. -> Similar to the Octokit.
12+
- Built to be a native companion with GitHub Actions with Workflow commands that you can use. -> Similar to the Octokit and github-scripts
13+
- A module that can be used in other PowerShell compatible automation environments, like FunctionApps. -> Similar to the Octokit.
14+
- A way to deploy, declare and manage resources in GitHub programmatically. -> Similar to Terraform and Pulumi.
815

9-
- **Comprehensive Access**: Harness the power of GitHub's REST API from your PowerShell console, providing you with capabilities to manage repositories, issues, pull requests, and more.
16+
## Supported platforms
1017

11-
- **Support for PowerShell Versions**: This module is tested and compatible with both PowerShell 7 and Windows PowerShell 5.1 ensuring wide accessibility.
12-
13-
- **Cross-Platform**: Whether you're on Windows, macOS, or Linux, GitHub PowerShell has you covered.
14-
15-
- **Modern Authentication**: Integrate seamlessly with GitHub's authentication methods, including personal access tokens and OAuth, for secure script execution.
16-
17-
- **Active Development and Community Support**: As with the open-source spirit of GitHub, this module invites contributors for constant improvement and evolution. Regular updates ensure that the module remains in sync with any changes to the GitHub REST API.
18-
19-
- **Intuitive Command Design**: Commands are structured logically, ensuring that even new users can get started quickly without a steep learning curve.
18+
As the module is built with the goal to support modern operators (assumed to use a newer OS), GitHub Actions and FunctionApps, the module
19+
will **only support the latest LTS version of PowerShell on Windows, macOS, and Linux**.
2020

2121
## Getting Started with GitHub PowerShell
2222

@@ -57,10 +57,6 @@ After this you will need to install the GitHub App on the repos you want to mana
5757

5858
> Info: We will be looking to include this as a check in the module in the future. So it becomes a part of the regular sign in process.
5959
60-
<!-- ```powershell
61-
Install-GitHubApp -Owner 'PSModule' -Repo 'GitHub'
62-
``` -->
63-
6460
Consecutive runs of the `Connect-GitHubAccount` will not require you to paste the code again unless you revoke the token
6561
or you change the type of authentication you want to use. Instead, it checks the remaining duration of the access token and
6662
uses the refresh token to get a new access token if its less than 4 hours remaining.
@@ -119,47 +115,21 @@ Familiarize yourself with the available cmdlets using the module's comprehensive
119115
Get-Command -Module GitHub
120116
```
121117

122-
### Sample Scripts
123-
124-
To be added: Sample scripts demonstrating the module's capabilities.
125-
126-
## More Information & Resources
127-
128-
- If you're new to PowerShell or GitHub's REST API, consider checking out the provided beginner guides for both.
129-
130-
- Explore detailed cmdlet documentation, tutorials, and community-contributed scripts to enhance your GitHub PowerShell experience.
131-
132-
- Join the community discussions, provide feedback, or contribute to the module's development on the repository's issues and pull requests sections.
133-
134-
Embrace the efficiency and power of scripting with **GitHub PowerShell** – Your gateway to GitHub automation and integration.
135-
136-
## PowerShell Module Development and Release Framework
137-
138-
We utilize the **[PSModule framework](https://github.com/PSModule/)** to streamline our module development and release process.
139-
140-
- **New-Module**: Quickly set up a consistent module structure that fits with the framework.
141-
- **Build-Module**: Construct the project for deployment to the [PowerShell Gallery](https://www.powershellgallery.com/) and publish documentation for [GitHub Pages](https://pages.github.com/).
142-
- **Test-Module**: Run comprehensive tests ensuring module quality.
143-
- **Release-Module**: Handle versioning, create repository releases, and publish to the PowerShell Gallery and GitHub Pages.
144-
145-
For a detailed understanding of the framework, [read more about PSModule here](https://github.com/PSModule/).
146-
147118
## References
148119

149120
### Official GitHub Resources
150121

151122
- [REST API Description](https://github.com/github/rest-api-description)
152123
- [GitHub CLI Manual](https://cli.github.com/manual/)
153124
- [GitHub Platform Samples](https://github.com/github/platform-samples)
125+
- [Octokit](https://github.com/octokit) [rest.js API docs](https://octokit.github.io/rest.js/v20) - GitHub API clients for different languages.
126+
- [actions/toolkit](https://github.com/actions/toolkit) - GitHub Actions Toolkit for JavaScript and TypeScript.
127+
- [actions/github-script](https://github.com/actions/github-script) - GitHub Action for running ts/js octokit scripts.
154128

155129
### General Web References
156130

157131
- [Generic HTTP Status Codes (MDN)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status)
158132

159-
### Tools Planned for Development
160-
161-
- [Azure AutoRest (OpenAPI Specification Code Generator)](https://github.com/Azure/autorest)
162-
163133
### Inspiration Behind the Project
164134

165135
- [Microsoft's PowerShellForGitHub](https://github.com/microsoft/PowerShellForGitHub)

tests/GitHub.Tests.ps1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,18 @@ Param(
77

88
Write-Verbose "Path to the module: [$Path]" -Verbose
99

10+
BeforeAll {
11+
Connect-GitHub
12+
}
13+
1014
Describe 'GitHub' {
15+
Context 'Invoke-GitHubAPI' {
16+
It 'Invoke-GitHubAPI function exists' {
17+
Get-Command Invoke-GitHubAPI | Should -Not -BeNullOrEmpty
18+
}
19+
20+
It 'Can be called directly to get ratelimits' {
21+
{ Invoke-GitHubAPI -ApiEndpoint '/rate_limit' -Method GET } | Should -Not -Throw
22+
}
23+
}
1124
}

0 commit comments

Comments
 (0)