I'm trying to publish a Ruby gem through the release-gem GitHub Action. I have copied the workflow suggested in the README:
name: publish
on:
release:
types: [published]
jobs:
release:
runs-on: ubuntu-24.04
permissions:
id-token: write
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ruby
# Publish the gem to RubyGems
- uses: rubygems/release-gem@v1
But when it runs, I get
Running `git push origin refs/heads/HEAD` failed with the following output:
error: src refspec refs/heads/HEAD does not match any
error: failed to push some refs to 'https://github.com/inforlife/gatekeeper-api-client'
According to several questions on SO, the error is commonly related to the fact that no commit has been made. In my case, several commits have been made as the code was pushed to GitHub.
What am I missing here?