This tool provides several different cli to interact with GitHub server.
- .NET Core 3.0+ is required to run this package.
- This tool provides as an .NetCore 3.0 tool package.
- NEW:
delete-packagecommand now allow to delete only pre-release versions.
# This command line with only delete pre-release versions (eg: 2.0.0-prerelease, 2.2.0-rc1, 2.2.0-build.22), But not release version (2.0.0)
github delete-package -t {YOUR_GITHUB_PAT} -o wuganhao -r GitHub.CommandLine -p GitHub.CommandLine -k 3 -m current -v 2.0.0 --prerelease-only- FIX: Update according to GitHub GraphQL api changes
- FIX: Use SemVersion 2.0 for version comparing
- FIX:
--prerelease-onlyis a switch instead of option
To install this tool. please run following command:
dotnet tool install --global GitHub.CommandLineAfter installing the tool you can run github delete-package to clean packages.
- Following command removes all package version for
GitHub.CommandLinefrom repositoryGitHub.CommandLinebut keeps the latest 5 versions
dotnet github delete-package -t ${{secrets.github_token}} -o wuganhao -r GitHub.CommandLine -p GitHub.CommandLine -k 5 -m all- Following command removes all package version for
GitHub.CommandLinewith version number4.0.0.*and keeps only the latest 5 versions.
dotnet github delete-package -t ${{secrets.github_token}} -o wuganhao -r GitHub.CommandLine -p GitHub.CommandLine -k 5 -m current -v 4.0.0- For using this tool in GitHub Actions, You can take the example in this repository. This repository use the same tool to cleanup itself. (When using this inside GitHub Actions, owner and repository name can be emitted)
- name: Setup .NET Core CLI
uses: actions/setup-dotnet@v1.1.0
- name: Remove older packages and keep only latest 5 versions
run: |
dotnet tool install --global GitHub.CommandLine
github delete-package -t ${{secrets.github_token}} -k 5 -m all- To get details about how to use this commands, Try
github delete-package --help.
- Run following command line for automatically merging all branch from pre-4.0.0 to 4.0.0. Break on any conflict, allow user to resolve conflicts and re-run this command line again.
github auto-merge -t 4.0.0 -c break- Run following command line for automatically merging all branch from pre-4.0.0 to 4.0.0. Skip on any conflict, and continue merging the all other version that has no conflicts. (This might cause more conflicts, as normally we have to merge from lower version then higher)
github auto-merge -t 4.0.0 -c skip- To get details about how to use this commands, Try
github delete-package --help.