How a V1.0.0 tag silently skipped my GitHub Actions publish workflow, and how to make sure it never happens again.

Background

I recently extracted the voice chat code that was duplicated in two of my Blazor Server games, Draughts and Reversi, into a shared Razor class library called GameVoice. It’s published on nuget.org as the GameVoice package.

Publishing is automated. A GitHub Actions workflow packs the library and pushes it to nuget.org whenever a version tag is pushed. It uses nuget.org Trusted Publishing, so no API key is stored in the repo. Three preview releases (v1.0.0-preview.1 to preview.3) went through without a hitch.

Then I released 1.0.0.

**Nb:* Things are configured such that I receive an email in the InBox for the account I use on Nuget whenever anything is published there.

What happened

I merged the library PR to main and created a GitHub release in the browser:

  • Title: First Release
  • Tag: V1.0.0
  • Target: main

GitHub created the tag and the release, and marked it Latest. Everything looked right.

But version 1.0.0 never appeared on nuget.org. There was no failed run and no error, because the Actions tab showed no run of the publish workflow at all.

The cause

Here’s the trigger in publish.yml:

on:
  push:
    tags: ['v*']

GitHub Actions tag and branch filters are case-sensitive glob patterns. v* matches v1.0.0 but not V1.0.0. Because the tag didn’t match, the workflow never started. Nothing failed, so nothing reported a problem.

A second problem was waiting even if the trigger had matched. The pack step took the version from the tag name:

- name: Pack
  run: dotnet pack src/GameVoice -c Release -o artifacts -p:Version=${GITHUB_REF_NAME#v}

${GITHUB_REF_NAME#v} is a bash parameter expansion that removes a leading lowercase v. With V1.0.0 it removes nothing, so the version passed to dotnet pack would be V1.0.0. That isn’t a valid NuGet version, so the run would have failed at that step instead.

Why it’s easy to fall into

  • Nothing warns you. GitHub’s “Create a new release” page accepts any tag name, and the release looks fine.
  • Both conventions are common. Plenty of projects write versions as “V1.0” in prose, and Windows users are used to case not mattering.
  • A missing run is quiet. A failed run sends an email and shows a red cross. A run that never started leaves no trace anywhere.
  • The README only showed an example. My instructions said “push a tag: git tag v1.0.1”, with no warning that the case matters.

The fix (immediate)

  1. Delete the V1.0.0 release and the V1.0.0 tag on GitHub.
  2. Create a new release with the tag v1.0.0 (lowercase) on main.
  3. Watch the Publish package run start in the Actions tab.
  4. Wait a few minutes for nuget.org to validate the package, then confirm 1.0.0 is listed.

Why delete the uppercase tag first

On GitHub (Linux), V1.0.0 and v1.0.0 are two separate tags. On Windows and on macOS with default settings, the file system ignores case. Git can store tags as files under .git/refs/tags/, so a clone on Windows may report conflicts or confusing errors when both tags exist. Keep only one.

The fix (permanent): make the workflow forgiving

Rather than relying on remembering the convention, I changed the workflow to accept both cases:

# Push a tag such as v1.0.1 to publish GameVoice 1.0.1 to nuget.org (V1.0.1 also works).
on:
  push:
    tags: ['v*', 'V*']

and remove either prefix when working out the version:

- name: Pack
  run: dotnet pack src/GameVoice -c Release -o artifacts -p:Version=${GITHUB_REF_NAME#[vV]}

${GITHUB_REF_NAME#[vV]} removes a single leading v or V, so both v1.0.1 and V1.0.1 produce version 1.0.1.

I also put a warning at the top of the release instructions in the README:

> [!IMPORTANT]
> The tag must start with `v` or `V` followed by the version, e.g. `v1.0.1`. Any other tag
> (such as `1.0.1` or `release-1.0.1`) does not publish anything.
> Git tags are case-sensitive but Windows is not, so don't create both `v1.0.1` and `V1.0.1`.

GitHub renders > [!IMPORTANT] as a highlighted callout box, which is about as close to “blazing lights” as Markdown gets.

Going further

Some further options, depending on how strict you want to be:

  • Fail loudly on badly formed tags. Trigger on every tag (tags: ['*']) and add a first step that checks the name with a regex such as ^[vV][0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.]+)?$. If it doesn’t match, run exit 1 with a clear message. A wrong tag then gives you a red cross instead of silence.
  • Protect your tags. A repository ruleset for tags can restrict who may create tags that match your release pattern, which reduces accidental releases.
  • Check after releasing. After creating a release, glance at the Actions tab. If no run started within a minute, the trigger didn’t match.

Takeaways

  1. GitHub Actions tags: and branches: filters are case-sensitive: v* does not match V1.0.0.
  2. A trigger that doesn’t match produces no run, no failure and no notification.
  3. Bash ${VAR#v} removes only the exact prefix you give it. Use ${VAR#[vV]} to handle both cases.
  4. Don’t keep tags that differ only by case. They’re distinct on GitHub but collide on Windows.
  5. Put conventions that are easy to break in a highlighted README callout, and preferably make the workflow handle both forms.

One capital letter cost me a confused half hour. Hopefully this saves you the same.


Nb: This blog post was generated by AI Tool Devin after resolving the issue

GameVoice is open source at github.com/djaus2/GameVoice and available on nuget.org as GameVoice.


 TopicSubtopic
<  Prev:   Markdown
   
 This Category Links 
Category:Application Dev Index:Application Dev