Trent Jones 685bc3493f links
2020-02-29 17:37:01 -06:00
2020-02-29 15:55:55 -06:00
2020-02-29 14:00:06 -06:00
2020-02-29 14:00:06 -06:00
2020-01-29 10:13:06 -05:00
2020-02-29 12:56:23 -06:00
2020-01-29 10:13:06 -05:00
2020-01-29 10:13:06 -05:00
2020-02-29 12:56:23 -06:00
2020-01-29 10:13:06 -05:00
2020-01-29 10:13:06 -05:00
2020-02-29 13:26:10 -06:00
2020-02-29 17:37:01 -06:00

Delete Package Versions

This action deletes versions of a package from GitHub Packages.

What It Can Do

  • Delete a single version
  • Delete multiple versions
  • Delete specific version(s)
  • Delete oldest version(s)
  • Delete version(s) from a package that is hosted in the same repo that is executing the workflow
  • Delete version(s) from a package that is hosted in a different repo than the one executing the workflow

Usage

- uses: actions/delete-package-versions@v1
  with:
  # Can be a single package version id, or a comma separated list of package version ids.
  # Defaults to an empty string.
  package-version-ids:
  
  # Owner of the repo hosting the package.
  # Defaults to the owner of the repo executing the workflow.
  # Required if deleting a version from a package hosted in a different repo than the one executing the workflow.
  owner:

  # Repo hosting the package.
  # Defaults to the repo executing the workflow.
  # Required if deleting a version from a package hosted in a different repo than the one executing the workflow.
  repo:

  # Name of the package.
  # Defaults to an empty string.
  # Required if `package-version-ids` input is not given.
  package-name:

  # The number of old versions to delete starting from the oldest version.
  # Defaults to 1.
  num-old-versions-to-delete:

  # The token used to authenticate with GitHub Packages.
  # Defaults to github.token.
  # Required if deleting a version from a package hosted in a different repo than the one executing the workflow.
  #   If `package-version-ids` is given the token only needs the delete packages scope.
  #   If `package-version-ids` is not given the token needs the delete packages scope and the read packages scope
  token:

Scenarios

Delete a specific version from a package hosted in the same repo as the workflow

Package version ids can be retrieved via the GitHub GraphQL API.

- uses: actions/delete-package-versions@v1
  with:
    package-version-ids: 'MDE0OlBhY2thZ2VWZXJzaW9uOTcyMDY3'

Delete a specific version from a package hosted in a different repo than the workflow

The token input is required to delete a version of a package hosted in a different repo than the workflow. The token only needs the delete packages scope. It is recommended to store the token as a secret. In this example the token was stored as a secret named GITHUB_PAT.

- uses: actions/delete-package-versions@v1
  with:
    package-version-ids: 'MDE0OlBhY2thZ2VWZXJzaW9uOTcyMDY3'
    token: ${{ secrets.GITHUB_PAT }}

License

The scripts and documentation in this project are released under the MIT License

Description
Mirror of github.com/actions/delete-package-versions
Readme 2 MiB
Languages
TypeScript 99.4%
JavaScript 0.6%