That seems to have been implemented in March 2022, as illustrated by the changelog post:
Repository owners can now configure tag protection rules to protect tags in all public repositories and in private repositories on the Pro, Teams or Enterprise plans on GitHub.
Once protected by a tag protection rule, tags matching specified patterns can only be created and deleted by users with "Maintain" or "Admin" permissions to the repository.
For more information, see our documentation.
And, now in public beta:
Protected tags
Our beta tag protection feature gives repo admins the option to protect tags on their repo.
If they choose to do so, only maintainers and admins will be able to create these tags, and only admins will be able to modify or delete these tags.
Tags are protected by patterns - you could protect all tags by using the "*
" pattern, but you don’t have to.
To set up and manage these tag protections, we’ve introduced three endpoints, which any repo admin should be able to use:
GET /repos/{owner/{repo}/tags/protection
Returns a list of tag protection rules.
POST /repos/{owner}/{repo}/tags/protection
Creates a new tag protection rule. Payload must include a pattern - example:
curl -" "Authorization: token $GITHUB_TOK"N"
-XPOST -d '{"pattern": "*"}'
https://api.github.com/repos/JasonEtco/testing/tags/protection
{
"id": 123456,
"pattern": "*",
"created_at": "2022-01-12T12:01:47.094-05:00",
"updated_at": "2022-01-12T12:01:47.094-05:00"
}
DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}
Deletes a tag protection rule.