Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when deleting packages #73

Open
DanJBower opened this issue Apr 24, 2022 · 1 comment
Open

Error when deleting packages #73

DanJBower opened this issue Apr 24, 2022 · 1 comment

Comments

@DanJBower
Copy link

I'm using NuGet packages in my GitHub packages, and I've set up a manual workflow to allow me to delete all but the 5 latest versions. It looks like this

name: Delete Old CI Builds

on:
  workflow_dispatch:

jobs:
  DeleteOldCiBuilds:
	name: Delete old CI releases
	runs-on: ubuntu-latest
	steps:
	- name: Delete Package Versions
	  uses: actions/[email protected]
	  with:
		package-name: MyPackageName
		min-versions-to-keep: 5
		token: ${{ github.token }}

However, when it runs, I get the following error message

Error: delete version mutation failed. Type mismatch on variable $packageVersionId and argument packageVersionId (String! / ID!)

The only other strange thing I noticed is that even know I was only using min-versions-to-keep, num-old-versions-to-delete still showed up in the full output.

Full output

Run actions/[email protected]
  with:
	package-name: MyPackageName
	min-versions-to-keep: 5
	token: ***
	num-old-versions-to-delete: 1
	ignore-versions: ^$
	delete-only-pre-release-versions: false
(node:1564) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Total versions deleted till now: 2
Error: delete version mutation failed. Type mismatch on variable $packageVersionId and argument packageVersionId (String! / ID!)

Also, even though it says Total versions deleted till now: 2, I checked my package versions, and no versions have been deleted.

A sample of what the versioning looks like for the package is

  • 0.0.5-ci-2215317956
  • 0.0.5
  • 0.0.4
  • 0.0.2-ci-2215161916
  • 0.0.2-ci-2215112987

I'd really appreciate any help fixing the issue as I would like to add this to one of my scheduled workflows, but it was causing it to fail.

@m3nax
Copy link

m3nax commented Aug 9, 2023

Hi, You didn't specify the type of package, but is required (DOC)

You can try add the type of package: package-type: nuget

Updated script

name: Delete Old CI Builds

on:
  workflow_dispatch:

jobs:
  DeleteOldCiBuilds:
	name: Delete old CI releases
	runs-on: ubuntu-latest
	steps:
	- name: Delete Package Versions
	  uses: actions/[email protected]
	  with:
                package-type: nuget
		package-name: MyPackageName
		min-versions-to-keep: 5
		token: ${{ github.token }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants