Coder Social home page Coder Social logo

wpmedia / delete-github-package-versions Goto Github PK

View Code? Open in Web Editor NEW
1.0 6.0 1.0 1.54 MB

Clear out many github packages' versions based on first or last order

Home Page: https://github.com/marketplace/actions/delete-github-packages-versions

License: MIT License

JavaScript 100.00%
version-control github-package-registry

delete-github-package-versions's Introduction

Delete old packages

ℹ️ NOTE: This package is no longer maintained nor used by Arc XP themes repos. It was originally created to target GitHub Packages starting from older versions to newer ones. This was forked from another library whose issue focuses on this reverse chronological functionality.

Github action for deleting old versions of packages in the Github package registry.

This is very similar to actions/delete-package-versions but targets a different use case.

The action works by getting at most 20 packages with at most the oldest 100 versions of each, applying the filters (see table below) on them and then deleting the matching versions.

If you have more than 100 versions and none of the 100 oldest versions match, no packages will be deleted! Note: If you are looking for the 100 newest version matches, use version-query-order first.

Inputs

Name Description Required Default
owner Owner of the repo containing the package(s) Set by Github
repo Repo containing the package(s) Set by Github
user User containing the package(s)
organization Organization containing the package(s)
names Names of the packages ✔️
semver-pattern Semver range of the versions ^.+$
version-pattern Regex pattern of the versions
version Specific version to delete
keep Number of versions to exclude from deletions 2
token Token with the necessary scopes to delete package versions Set by Github
dry-run If the action should only print what it would do. false
version-query-order Where to start looking for version regex matches. Default is "last". You can pick "first". last

⚠️ You can provide either owner and repo, user or organization. An error is thrown for invalid combinations.

⚠️ You can provide either version, semver-pattern or version-pattern. An error is thrown for invalid combinations.

⚠️ keep can not be set when version is set.

Example usage

Delete old versions of the packages "package-1" and "package-2" for the current repository.

uses: WPMedia/[email protected]
with:
  names: |
    package-1
    package-2

Delete old versions of the packages "package-1" and "package-2" for the organization "my-organization".

uses: WPMedia/[email protected]
with:
  organization: my-organization
  names: |
    package-1
    package-2

Delete old versions in the form of "1.0.0-RC1" of the package "package".

uses: WPMedia/[email protected]
with:
  version-pattern: "^\\d+\\.\\d+\\.\\d+-RC\\d+$" # The regex needs to be escaped!
  names: |
    package

Delete old versions with a lower semver version than 2.x of the package "package".

uses: WPMedia/[email protected]
with:
  semver-pattern: "<2.x"
  names: |
    package

Delete old versions of the package "package" but keep at least 5 versions.

uses: WPMedia/[email protected]
with:
  keep: 5
  names: |
    package

Delete version foo-bar of the package "package".

uses: WPMedia/[email protected]
with:
  version: foo-bar
  names: |
    package

delete-github-package-versions's People

Contributors

dependabot[bot] avatar jackhowa avatar kcerb avatar rubengees avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

blue-agency

delete-github-package-versions's Issues

Variable $version of type String! was provided invalid value

Im currently trying to delete a ruby gem package:

$ gem install packagename--version "0.0.1" --source "https://rubygems.pkg.github.com/twsl" 
- name: Delete GitHub Packages Versions
  uses: WPMedia/[email protected]
  with:
    version: 0.0.1
    token: ${{secrets.GITHUB_TOKEN}}
    names: |
      packagename

But I do get the exception Variable $version of type String! was provided invalid value. What am I doing wrong?

Trying semver-pattern: "=0.0.1" doesn't result in deleting of said package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.