Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Fix issue where deleting tags failed #29

Merged

Conversation

wardellbagby
Copy link
Contributor

  • Octokit's deleteRef function expects a ref without a preceding "ref/", so deleting a tag should have it be passed a string in the form of "tags/tagName". This was previously passing in a tag in the form of "refs/tags/tagName", which was an error.

@thadguidry
Copy link
Collaborator

Indeed.

https://octokit.github.io/octokit.rb/Octokit/Client/Refs.html#delete_ref-instance_method

#delete_ref(repo, ref, options = {}) ⇒ Boolean
Also known as: delete_reference
Delete a single reference

Examples:

Delete tags/v0.0.3 for sferik/rails_admin

Octokit.delete_ref("sferik/rails_admin","tags/v0.0.3")

Parameters:

  • repo (Integer, String, Repository, Hash) — A GitHub repository
  • ref (String) — The ref, e.g. tags/v0.0.3

Returns:

  • (Boolean) — Success

See Also:

@thadguidry
Copy link
Collaborator

thadguidry commented Mar 23, 2023

I think it also would be more pleasing that our code used only 2 parameters to coincide with Octokit's methods? repo, ref instead of owner, repo, ref ? This would be less confusing to others coming in to help don't you think? Could you make a new issue if you agree?

@wardellbagby
Copy link
Contributor Author

I think it also would be more pleasing that our code used only 2 parameters to coincide with Octokit's methods? repo, ref instead of owner, repo, ref ? This would be less confusing to others coming in to help don't you think? Could you make a new issue if you agree?

That's the Octokit Ruby client that only uses repo and ref. The Octokit JS client requires owner repo and ref individually supplied. Attempting to not supply owner is an error.

https://octokit.github.io/rest.js/v18#git-delete-ref

@wardellbagby
Copy link
Contributor Author

wardellbagby commented Mar 23, 2023

I see some conflicts popped up. I'll fix those in a few hours when I'm home.

@thadguidry Conflicts resolved.

- Octokit's deleteRef function expects a ref without a preceding "ref/",
so deleting a tag should have it be passed a string in the form of
"tags/tagName". This was previously passing in a tag in the form of
"refs/tags/tagName", which was an error.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants