### Filter Versions with Regex Source: https://context7.com/actions/delete-package-versions/llms.txt Excludes specific versions from deletion using regex patterns with the `ignore-versions` parameter. This example preserves all major release versions (e.g., 1.0.0, 2.0.0). ```yaml - name: Delete versions except major releases uses: actions/delete-package-versions@v5 with: package-name: 'my-package' package-type: 'npm' min-versions-to-keep: 3 ignore-versions: '^(0|[1-9]\d*)\.0\.0$' ``` -------------------------------- ### Get Version IDs for Deletion Source: https://context7.com/actions/delete-package-versions/llms.txt Retrieve a list of version IDs that would be deleted based on current input configuration, useful for dry-run scenarios. ```APIDOC ## GET /finalIds ### Description Retrieves the list of version IDs targeted for deletion based on the input configuration. ### Method GET ### Response #### Success Response (200) - **ids** (string[]) - List of version IDs to be deleted ``` -------------------------------- ### GitHub Action: delete-package-versions Source: https://github.com/actions/delete-package-versions/blob/main/README.md Configuration parameters for the delete-package-versions GitHub Action. ```APIDOC ## GitHub Action: actions/delete-package-versions@v5 ### Description This action deletes versions of a package from GitHub Packages. It supports deleting specific versions by ID or applying retention policies to automatically clean up old versions. ### Parameters #### Request Body (with) - **package-name** (string) - Required - Name of the package. - **package-type** (string) - Required - Type of the package (docker, container, maven, npm, nuget, or rubygems). - **package-version-ids** (string) - Optional - Single package version ID or comma-separated list of IDs. - **owner** (string) - Optional - Owner of the package. Defaults to the repo owner. - **num-old-versions-to-delete** (integer) - Optional - Number of old versions to delete starting from the oldest. Defaults to 1. - **min-versions-to-keep** (integer) - Optional - Number of latest versions to keep. - **ignore-versions** (string) - Optional - Regex for version names to exclude from deletion. - **delete-only-pre-release-versions** (boolean) - Optional - If true, deletes only pre-release versions. Defaults to false. - **delete-only-untagged-versions** (boolean) - Optional - If true, deletes only untagged versions (container packages only). Defaults to false. - **token** (string) - Optional - GitHub token for authentication. Defaults to github.token. ### Request Example - uses: actions/delete-package-versions@v5 with: package-name: "my-package" package-type: "npm" min-versions-to-keep: 5 ``` -------------------------------- ### Query Package Version Metadata Source: https://context7.com/actions/delete-package-versions/llms.txt Fetches version information from the GitHub Packages API with support for pagination. ```typescript import { getOldestVersions, RestVersionInfo, RestQueryInfo } from './version' // RestVersionInfo structure interface RestVersionInfo { id: number // Version ID version: string // Version name/tag created_at: string // ISO timestamp tagged: boolean // Whether container is tagged (container only) } // RestQueryInfo structure (API response) interface RestQueryInfo { versions: RestVersionInfo[] page: number paginate: boolean // Whether more pages exist totalCount: number } getOldestVersions( 'my-org', // owner 'my-package', // packageName 'npm', // packageType 100, // numVersions (per page) 1, // page number process.env.GITHUB_TOKEN ).subscribe({ next: (queryInfo: RestQueryInfo) => { console.log('Page:', queryInfo.page) console.log('Has more pages:', queryInfo.paginate) console.log('Versions on page:', queryInfo.totalCount) queryInfo.versions.forEach((v: RestVersionInfo) => { console.log(`ID: ${v.id}, Version: ${v.version}, Created: ${v.created_at}`) }) }, error: (err) => { console.error('API error:', err) } }) ``` -------------------------------- ### Query Package Versions Source: https://context7.com/actions/delete-package-versions/llms.txt Retrieve version information from GitHub Packages API with pagination support. ```APIDOC ## GET /getOldestVersions ### Description Fetches a paginated list of package versions from the GitHub Packages API. ### Parameters #### Query Parameters - **owner** (string) - Required - Package owner - **packageName** (string) - Required - Name of the package - **packageType** (string) - Required - Type of package - **numVersions** (number) - Required - Versions per page - **page** (number) - Required - Page number - **token** (string) - Required - GitHub token ### Response #### Success Response (200) - **versions** (RestVersionInfo[]) - List of version objects - **page** (number) - Current page number - **paginate** (boolean) - Whether more pages exist - **totalCount** (number) - Total versions on page ``` -------------------------------- ### Delete multiple specific package versions with token Source: https://github.com/actions/delete-package-versions/blob/main/README.md When deleting multiple specific versions of a package from a repository that lacks direct package access, provide the `package-version-ids`, `package-name`, `package-type`, and a `token` for authentication. ```yaml - uses: actions/delete-package-versions@v5 with: package-version-ids: 'MDE0OlBhY2thZ2VWZXJzaW9uOTcyMDY3, MDE0OlBhY2thZ2VWZXJzaW9uOTcyMzQ5, MDE0OlBhY2thZ2VWZXJzaW9uOTcyMzUw' package-name: 'test-package' package-type: 'npm' token: ${{ secrets.PAT }} ``` -------------------------------- ### Keep Minimum Versions (Retention Policy) Source: https://context7.com/actions/delete-package-versions/llms.txt Retains a minimum number of the latest versions while deleting all older versions. Use `min-versions-to-keep` to set the retention count. ```yaml - name: Keep only 10 latest versions uses: actions/delete-package-versions@v5 with: package-name: 'my-package' package-type: 'npm' min-versions-to-keep: 10 ``` -------------------------------- ### Configure Delete Package Versions Action Source: https://github.com/actions/delete-package-versions/blob/main/README.md Use this YAML configuration in your workflow file to define package deletion parameters. Ensure the required fields like package-name and package-type are provided. ```yaml - uses: actions/delete-package-versions@v5 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 package. # Defaults to the owner of the repo executing the workflow. # Required if deleting a version from a package hosted in a different org than the one executing the workflow. owner: # Name of the package. # Required package-name: # Type of the package. Can be one of docker (v4 or older), container (v5 or newer), maven, npm, nuget, or rubygems. # Required package-type: # The number of old versions to delete starting from the oldest version. # Defaults to 1. num-old-versions-to-delete: # The number of latest versions to keep. # This cannot be specified with `num-old-versions-to-delete`. By default, `min-versions-to-keep` takes precedence over `num-old-versions-to-delete`. # When set to 0, all deletable versions will be deleted. # When set greater than 0, all deletable package versions except the specified number will be deleted. min-versions-to-keep: # The package versions to exclude from deletion. # Takes regex for the version name as input. # By default nothing is ignored. This is ignored when `delete-only-pre-release-versions` is true ignore-versions: # If true it will delete only the pre-release versions. # The number of pre-release versions to keep can be set by using `min-versions-to-keep` value with this. # When `min-versions-to-keep` is 0, all pre-release versions get deleted. # Defaults to false. # Cannot be used with `num-old-versions-to-delete` and `ignore-versions`. delete-only-pre-release-versions: # If true it will delete only the untagged versions in case of container package. # Does not work for other package types and will be ignored. # The number of untagged versions to keep can be set by using `min-versions-to-keep` value with this. # When `min-versions-to-keep` is 0, all untagged versions get deleted. # Defaults to false. # Cannot be used with `num-old-versions-to-delete`. delete-only-untagged-versions: # The token used to authenticate with GitHub Packages. # Defaults to github.token. # Required if the repo running the workflow does not have access to delete the package. # For rubygems and maven package, repo has access if package is hosted in the same repo as the workflow. # For container, npm and nuget package, repo has access if assigned **Admin** role under Package Settings > Manage Actions Access. # 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: ``` -------------------------------- ### GitHub Enterprise Server Support Source: https://context7.com/actions/delete-package-versions/llms.txt The action automatically detects GitHub Enterprise Server (GHES) environments using the `GITHUB_API_URL` environment variable. For GHES, the action uses `process.env.GITHUB_API_URL`. ```yaml # For GHES, the action uses process.env.GITHUB_API_URL # Example: https://github.mycompany.com/api/v3 - name: Delete versions on GHES uses: actions/delete-package-versions@v5 with: package-name: 'enterprise-package' package-type: 'nuget' min-versions-to-keep: 20 token: ${{ secrets.GHES_TOKEN }} ``` -------------------------------- ### Delete All Except Latest 2 Versions with Owner and Token Source: https://github.com/actions/delete-package-versions/blob/main/README.md Deletes all package versions except the latest 2, from a repository where the action may not have direct package access. Requires owner, package-name, token, and package-type. ```yaml - uses: actions/delete-package-versions@v5 with: owner: 'github' package-name: 'test-package' package-type: 'npm' token: ${{ secrets.PAT }} min-versions-to-keep: 2 ``` -------------------------------- ### Configure Input Parameters for Deletion Source: https://context7.com/actions/delete-package-versions/llms.txt Defines the Input class configuration and validation logic required for package version operations. ```typescript import { Input, InputParams } from './input' // InputParams interface interface InputParams { packageVersionIds?: string[] // Specific version IDs to delete owner?: string // Package owner (defaults to repo owner) packageName?: string // Required: Name of the package packageType?: string // Required: container, maven, npm, nuget, rubygems numOldVersionsToDelete?: number // Number of oldest versions to delete minVersionsToKeep?: number // Minimum versions to retain (-1 = disabled) ignoreVersions?: RegExp // Regex pattern for versions to skip token?: string // GitHub token with packages scope deletePreReleaseVersions?: string // 'true' to delete only pre-releases deleteUntaggedVersions?: string // 'true' to delete only untagged (container only) } // Create input configuration const input = new Input({ owner: 'my-org', packageName: 'my-package', packageType: 'npm', numOldVersionsToDelete: 10, minVersionsToKeep: -1, ignoreVersions: /^1\.0\.0$/, token: process.env.GITHUB_TOKEN }) // Validate input combination if (input.checkInput()) { console.log('Input is valid') } // Check if required query info is present if (input.hasOldestVersionQueryInfo()) { console.log('Can query for oldest versions') } ``` -------------------------------- ### Delete pre-release package versions Source: https://github.com/actions/delete-package-versions/blob/main/README.md Configures the action to keep a specific number of recent pre-release versions. Requires package-name, min-versions-to-keep, and delete-only-pre-release-versions. ```yaml - uses: actions/delete-package-versions@v5 with: package-name: 'test-package' package-type: 'npm' min-versions-to-keep: 10 delete-only-pre-release-versions: "true" ``` ```yaml - uses: actions/delete-package-versions@v5 with: owner: 'github' package-name: 'test-package' package-type: 'npm' token: ${{ secrets.GITHUB_PAT }} min-versions-to-keep: 10 delete-only-pre-release-versions: "true" ``` -------------------------------- ### Delete versions while ignoring specific patterns Source: https://github.com/actions/delete-package-versions/blob/main/README.md Keeps a set number of versions while excluding those that match a provided regex pattern. Requires the delete and read packages scope for the token. ```yaml - uses: actions/delete-package-versions@v5 with: package-name: 'test-package' package-type: 'npm' min-versions-to-keep: 3 ignore-versions: '^(0|[1-9]\d*)\.0\.0$' ``` ```yaml - uses: actions/delete-package-versions@v5 with: owner: 'github' package-name: 'test-package' package-type: 'npm' token: ${{ secrets.GITHUB_PAT }} min-versions-to-keep: 3 ignore-versions: '^(0|[1-9]\d*)\.0\.0$' ``` -------------------------------- ### Delete Only Pre-Release Versions Source: https://context7.com/actions/delete-package-versions/llms.txt Targets only pre-release versions for deletion while preserving stable releases. The action automatically filters using semver patterns when `delete-only-pre-release-versions` is set to 'true'. ```yaml - name: Clean up pre-release versions uses: actions/delete-package-versions@v5 with: package-name: 'my-package' package-type: 'npm' min-versions-to-keep: 5 delete-only-pre-release-versions: 'true' ``` -------------------------------- ### GitHub Action: Clean Maven Snapshots, Keep Releases Source: https://context7.com/actions/delete-package-versions/llms.txt Configure this step to clean snapshot versions of Maven artifacts while preserving release versions, ensuring a minimum number of releases are kept. ```yaml cleanup-maven-artifacts: runs-on: ubuntu-latest steps: - name: Clean snapshots, keep releases uses: actions/delete-package-versions@v5 with: package-name: 'com.example.mylib' package-type: 'maven' min-versions-to-keep: 5 ignore-versions: '^\d+\.\d+\.\d+$' # Keep semantic versions ``` -------------------------------- ### GitHub Action: Keep Last 20 Tagged Container Images Source: https://context7.com/actions/delete-package-versions/llms.txt This workflow step ensures that the last 20 tagged container images are kept, ignoring versions matching common tags like 'latest' or 'main'. ```yaml - name: Keep last 20 tagged images uses: actions/delete-package-versions@v5 with: package-name: 'my-app' package-type: 'container' min-versions-to-keep: 20 ignore-versions: '^latest$|^main$|^v\d+\.\d+\.\d+$' ``` -------------------------------- ### Delete a single package version Source: https://github.com/actions/delete-package-versions/blob/main/README.md Use this action to delete a single version of a package. Provide the package version ID, name, type, and a PAT for authentication. ```yaml - uses: actions/delete-package-versions@v5 with: package-version-ids: 'MDE0OlBhY2thZ2VWZXJzaW9uOTcyMDY3' package-name: 'test-package' package-type: 'npm' token: ${{ secrets.PAT }} ``` -------------------------------- ### Delete Specific Package Version by ID with Owner and Token Source: https://github.com/actions/delete-package-versions/blob/main/README.md Deletes a specific package version using its ID from a repository where the action may not have direct package access. Requires package-version-ids, token, package-name, and package-type. ```yaml - uses: actions/delete-package-versions@v5 with: owner: 'github' package-name: 'test-package' package-type: 'npm' token: ${{ secrets.PAT }} package-version-ids: 'MDE0OlBhY2thZ2VWZXJzaW9uOTcyMDY3' ``` -------------------------------- ### Delete All Except Latest 2 Versions Source: https://github.com/actions/delete-package-versions/blob/main/README.md Deletes all package versions except for the 2 most recent ones. Requires package-name and package-type. ```yaml - uses: actions/delete-package-versions@v5 with: package-name: 'test-package' package-type: 'npm' min-versions-to-keep: 2 ``` -------------------------------- ### Delete 3 Oldest Versions (Excluding Major) with Owner and Token Source: https://github.com/actions/delete-package-versions/blob/main/README.md Deletes the 3 oldest package versions, ignoring major versions, from a repository where the action may not have direct package access. Requires owner, package-name, token, and package-type. ```yaml - uses: actions/delete-package-versions@v5 with: owner: 'github' package-name: 'test-package' package-type: 'npm' token: ${{ secrets.PAT }} num-old-versions-to-delete: 3 ignore-versions: '^(0|[1-9]\d*)\.0\.0$' ``` -------------------------------- ### GitHub Action: Delete Old npm Pre-releases Source: https://context7.com/actions/delete-package-versions/llms.txt Configure this step in a GitHub Actions workflow to delete old pre-release versions of an npm package, keeping a specified minimum number of versions. ```yaml name: Package Retention Policy on: schedule: - cron: '0 2 * * 1' # Every Monday at 2 AM workflow_dispatch: jobs: cleanup-npm-packages: runs-on: ubuntu-latest steps: - name: Delete old npm pre-releases uses: actions/delete-package-versions@v5 with: package-name: 'my-npm-package' package-type: 'npm' min-versions-to-keep: 10 delete-only-pre-release-versions: 'true' ``` -------------------------------- ### Execute Bulk Version Deletion Source: https://context7.com/actions/delete-package-versions/llms.txt Uses the deleteVersions function to perform deletions based on provided input configuration. ```typescript import { deleteVersions } from './delete' import { Input } from './input' const input = new Input({ owner: 'my-org', packageName: 'my-package', packageType: 'npm', minVersionsToKeep: 5, token: process.env.GITHUB_TOKEN }) deleteVersions(input).subscribe({ next: (result) => { console.log('Deletion result:', result) }, error: (err) => { console.error('Deletion failed:', err) }, complete: () => { console.log('All deletions complete') } }) ``` -------------------------------- ### Delete All Versions Source: https://context7.com/actions/delete-package-versions/llms.txt Deletes all versions of a package by setting `min-versions-to-keep` to 0. ```yaml - name: Delete all package versions uses: actions/delete-package-versions@v5 with: package-name: 'my-package' package-type: 'container' min-versions-to-keep: 0 ``` -------------------------------- ### Delete Oldest 3 Versions with Owner and Token Source: https://github.com/actions/delete-package-versions/blob/main/README.md Deletes the 3 oldest package versions from a repository where the action may not have direct package access. Requires owner, package-name, token, and package-type. ```yaml - uses: actions/delete-package-versions@v5 with: owner: 'github' package-name: 'test-package' package-type: 'npm' num-old-versions-to-delete: 3 token: ${{ secrets.GITHUB_PAT }} ``` -------------------------------- ### Cross-Repository Package Deletion Source: https://context7.com/actions/delete-package-versions/llms.txt Deletes versions from a package in a different repository or organization using the `owner` and `token` parameters. The provided token must have `delete:packages` and `read:packages` scopes. ```yaml - name: Delete versions from external package uses: actions/delete-package-versions@v5 with: owner: 'other-org' package-name: 'shared-package' package-type: 'maven' min-versions-to-keep: 5 token: ${{ secrets.GITHUB_PAT }} ``` -------------------------------- ### Delete Oldest Version with Owner and Token Source: https://github.com/actions/delete-package-versions/blob/main/README.md Deletes the oldest package version from a repository where the action may not have direct package access. Requires owner, package-name, token, and package-type. ```yaml - uses: actions/delete-package-versions@v5 with: owner: 'github' package-name: 'test-package' package-type: 'npm' token: ${{ secrets.PAT }} ``` -------------------------------- ### Retrieve Version IDs for Dry-Run Source: https://context7.com/actions/delete-package-versions/llms.txt Retrieves a list of version IDs targeted for deletion without executing the actual deletion process. ```typescript import { finalIds, RATE_LIMIT } from './delete' import { Input } from './input' const input = new Input({ owner: 'my-org', packageName: 'my-package', packageType: 'npm', minVersionsToKeep: 10, token: process.env.GITHUB_TOKEN }) // RATE_LIMIT is 100 - maximum versions processed per run console.log('Max versions per run:', RATE_LIMIT) finalIds(input).subscribe({ next: (ids) => { console.log('Versions to delete:', ids) console.log('Count:', ids.length) }, error: (err) => { console.error('Failed to get version IDs:', err) } }) ``` -------------------------------- ### Delete 3 Oldest Versions (Excluding Major) Source: https://github.com/actions/delete-package-versions/blob/main/README.md Deletes the 3 oldest package versions, ignoring any that match the major version semver pattern. Requires package-name and package-type. ```yaml - uses: actions/delete-package-versions@v5 with: package-name: 'test-package' package-type: 'npm' num-old-versions-to-delete: 3 ignore-versions: '^(0|[1-9]\d*)\.0\.0$' ``` -------------------------------- ### GitHub Action: Delete Untagged Container Images Source: https://context7.com/actions/delete-package-versions/llms.txt Use this configuration to remove untagged container images, retaining a minimum number of tagged versions. This is useful for cleaning up build artifacts. ```yaml cleanup-container-images: runs-on: ubuntu-latest steps: - name: Delete untagged images uses: actions/delete-package-versions@v5 with: package-name: 'my-app' package-type: 'container' min-versions-to-keep: 5 delete-only-untagged-versions: 'true' ``` -------------------------------- ### Delete Oldest 3 Versions Source: https://github.com/actions/delete-package-versions/blob/main/README.md Deletes the 3 oldest package versions. Requires package-name and package-type. ```yaml - uses: actions/delete-package-versions@v5 with: package-name: 'test-package' package-type: 'npm' num-old-versions-to-delete: 3 ``` -------------------------------- ### Delete Package Versions Source: https://context7.com/actions/delete-package-versions/llms.txt Programmatically delete package versions based on provided input configuration. ```APIDOC ## POST /deleteVersions ### Description Deletes package versions based on the provided input configuration. Returns an RxJS Observable for asynchronous handling. ### Method POST ### Request Body - **owner** (string) - Optional - Package owner (defaults to repo owner) - **packageName** (string) - Required - Name of the package - **packageType** (string) - Required - Type of package (container, maven, npm, nuget, rubygems) - **minVersionsToKeep** (number) - Optional - Minimum versions to retain - **token** (string) - Required - GitHub token with packages scope ### Response #### Success Response (200) - **result** (any) - Deletion result object ``` -------------------------------- ### Delete Multiple Package Versions Concurrently Source: https://context7.com/actions/delete-package-versions/llms.txt Use this function to delete multiple package versions in parallel. Ensure the necessary imports are included. ```typescript import { deletePackageVersions } from './version' const versionIds = ['12345678', '12345679', '12345680'] deletePackageVersions( versionIds, 'my-org', 'my-package', 'container', process.env.GITHUB_TOKEN ).subscribe({ next: (result) => { console.log('Version deleted:', result) }, error: (err) => { console.error('Batch delete error:', err) }, complete: () => { console.log('All versions processed') } }) ``` -------------------------------- ### Delete multiple specific package versions Source: https://github.com/actions/delete-package-versions/blob/main/README.md To delete multiple specific versions of a package, use the `package-version-ids` input with a comma-separated string of IDs. Package version IDs can be retrieved via the GitHub REST API. ```yaml - uses: actions/delete-package-versions@v5 with: package-version-ids: 'MDE0OlBhY2thZ2VWZXJzaW9uOTcyMDY3, MDE0OlBhY2thZ2VWZXJzaW9uOTcyMzQ5, MDE0OlBhY2thZ2VWZXJzaW9uOTcyMzUw' package-name: 'test-package' package-type: 'npm' ``` -------------------------------- ### Delete Oldest Version Source: https://github.com/actions/delete-package-versions/blob/main/README.md Deletes the single oldest package version. Requires package-name and package-type. ```yaml - uses: actions/delete-package-versions@v5 with: package-name: 'test-package' package-type: 'npm' ``` -------------------------------- ### Delete Multiple Oldest Versions Source: https://context7.com/actions/delete-package-versions/llms.txt Deletes a specified number of the oldest versions from a package using the `num-old-versions-to-delete` parameter. ```yaml - name: Delete 5 oldest versions uses: actions/delete-package-versions@v5 with: package-name: 'my-package' package-type: 'npm' num-old-versions-to-delete: 5 ``` -------------------------------- ### Delete Oldest Package Version Source: https://context7.com/actions/delete-package-versions/llms.txt Deletes the single oldest version of a package. This is the default behavior when no additional options are specified. Configure this in your .github/workflows/cleanup-packages.yml file. ```yaml name: Package Cleanup on: schedule: - cron: '0 0 * * 0' # Weekly on Sunday workflow_dispatch: jobs: delete-old-versions: runs-on: ubuntu-latest steps: - name: Delete oldest package version uses: actions/delete-package-versions@v5 with: package-name: 'my-package' package-type: 'npm' ``` -------------------------------- ### Delete Specific Package Version by ID Source: https://github.com/actions/delete-package-versions/blob/main/README.md Deletes a specific package version using its unique ID. Requires package-version-ids, package-name, and package-type. IDs can be obtained from the GitHub REST API. ```yaml - uses: actions/delete-package-versions@v5 with: package-version-ids: 'MDE0OlBhY2thZ2VWZXJzaW9uOTcyMDY3' package-name: 'test-package' package-type: 'npm' ``` -------------------------------- ### Delete Single Package Version Source: https://context7.com/actions/delete-package-versions/llms.txt Delete a specific package version by its unique ID. ```APIDOC ## DELETE /deletePackageVersion ### Description Deletes a specific package version by ID. ### Method DELETE ### Parameters #### Path Parameters - **packageVersionId** (string) - Required - The ID of the version to delete ### Request Body - **owner** (string) - Required - Package owner - **packageName** (string) - Required - Name of the package - **packageType** (string) - Required - Type of package - **token** (string) - Required - GitHub token ### Response #### Success Response (200) - **success** (boolean) - Returns true on success ``` -------------------------------- ### Delete Untagged Container Versions Source: https://context7.com/actions/delete-package-versions/llms.txt For container packages, deletes untagged image versions while keeping tagged ones using `delete-only-untagged-versions: 'true'`. This is useful for cleaning up intermediate build layers. ```yaml - name: Delete untagged container images uses: actions/delete-package-versions@v5 with: package-name: 'my-container-image' package-type: 'container' min-versions-to-keep: 10 delete-only-untagged-versions: 'true' ``` -------------------------------- ### Delete a Single Package Version Source: https://context7.com/actions/delete-package-versions/llms.txt Deletes a specific package version by its unique ID. ```typescript import { deletePackageVersion } from './version' deletePackageVersion( '12345678', // packageVersionId 'my-org', // owner 'my-package', // packageName 'npm', // packageType process.env.GITHUB_TOKEN ).subscribe({ next: (success) => { if (success) { console.log('Version deleted successfully') } }, error: (err) => { console.error('Delete failed:', err) } }) ``` -------------------------------- ### Delete untagged container versions Source: https://github.com/actions/delete-package-versions/blob/main/README.md Removes older untagged container versions while keeping a specified number of the most recent ones. ```yaml - uses: actions/delete-package-versions@v5 with: package-name: 'test-package' package-type: 'container' min-versions-to-keep: 10 delete-only-untagged-versions: 'true' ``` -------------------------------- ### Delete Specific Version IDs Source: https://context7.com/actions/delete-package-versions/llms.txt Deletes specific versions by providing their version IDs directly in the `package-version-ids` parameter. Version IDs can be retrieved via the GitHub REST API. ```yaml - name: Delete specific versions by ID uses: actions/delete-package-versions@v5 with: package-name: 'my-package' package-type: 'npm' package-version-ids: 'MDE0OlBhY2thZ2VWZXJzaW9uOTcyMDY3, MDE0OlBhY2thZ2VWZXJzaW9uOTcyMzQ5' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.