AnswerDotAI / AnswerDotAI/ghapi

Unable to delete packages for user

Open
#132 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
685
Forks
70
Avg merge
1m
Merged PRs (30d)
2

Description

When using this API from within a GitHub Action, the API returns a 404 error when attempting to use `delete_package_version_for_authenticated_user`. However, doing a manual curl command to the same URL (with auth token) succeeded.

```
{'data': None,
'full_url': 'https://api.github.com/user/packages/container/paperless-ngx/versions/16658258',
'headers': {'Accept': 'application/vnd.github.v3+json'},
'method': 'DELETE'}
_main()
File "/home/runner/work/paperless-ngx/paperless-ngx/.github/scripts/cleanup-tags.py", line 197, in _main
api.packages.delete_package_version_for_authenticated_user(
File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/ghapi/core.py", line 63, in __call__
return self.client(self.path, self.verb, headers=headers, route=route_p, query=query_p, data=data_p)
File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/ghapi/core.py", line 112, in __call__
res,self.recv_hdrs = urlsend(path, verb, headers=headers or None, debug=self.debug, return_headers=True,
File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/fastcore/net.py", line 212, in urlsend
return urlread(req, return_json=return_json, return_headers=return_headers)
File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/fastcore/net.py", line 113, in urlread
if 400 <= e.code < 500: raise ExceptionsHTTP[e.code](e.url, e.hdrs, e.fp) from None
fastcore.basics.HTTP404NotFoundError: HTTP Error 404: Not Found
```

vs
```
curl -X DELETE -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ghp_*************" https://api.github.com/user/packages/container/paperless-ngx/versions/16658258
```

Previously in the same code, `get_all_package_versions_for_package_owned_by_authenticated_user` worked without issue, so I don't believe it is an access issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.