https://github.com/shgtkshruch/delete-github-packages-with-graphql-api
https://github.com/shgtkshruch/delete-github-packages-with-graphql-api
github-packages graphql
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/shgtkshruch/delete-github-packages-with-graphql-api
- Owner: shgtkshruch
- Created: 2019-12-16T15:39:23.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-17T00:58:23.000Z (about 6 years ago)
- Last Synced: 2025-01-26T19:13:31.788Z (about 1 year ago)
- Topics: github-packages, graphql
- Language: JavaScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Delete GitHub Packages through [GitHub GraphQL API v4](https://developer.github.com/v4/).
## Install
```sh
git clone git@github.com:shgtkshruch/delete-github-packages-with-graphql-api.git
cd delete-github-packages-with-graphql-api
npm i
```
## Set up
1. Get [GiHub personal access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line).
Add scopes below.
- `repo`
- `read:packages`
- `delete:packages`
2. Set environment variables.
```sh
# bash
export GITHUB_API_TOKEN="xxx"
# fish
set -x GITHUB_API_TOKEN xxx
```
## Command
```sh
# Get package version ID
node get.js [owner] [repository name]
# Delete specific version package
node delete.js [package version ID]
```