From a7c846d3cb36a3d289afe1b883b9beff538ad5c2 Mon Sep 17 00:00:00 2001 From: Joel Hawksley Date: Mon, 24 Aug 2026 14:09:35 -0600 Subject: [PATCH] Trigger push_gem workflow after tagging, and allow manual dispatch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Publishing 4.14.0 tagged v4.14.0 and created the GitHub release, but push_gem.yml did not run and no gem was pushed to RubyGems. Root cause: GitHub Actions does not trigger downstream workflows for events driven by GITHUB_TOKEN. script/publish now runs inside the publish-release workflow, which uses GITHUB_TOKEN for its checkout — so the 'git push origin v4.14.0' from that job does not fire the 'push: tags: v*' event on push_gem.yml. Previous releases were tagged by a maintainer running script/publish locally with a PAT, which is why push_gem always fired for them. Two changes: - Add a workflow_dispatch trigger to push_gem.yml with a required 'tag' input, and check that tag out. This lets a maintainer manually push the gem for a specific tag (needed right now to publish v4.14.0 to RubyGems). - At the end of script/publish, dispatch push_gem.yml with the freshly created tag. || true so any dispatch failure never masks a successful release. This makes future releases push the gem automatically even when script/publish runs from Actions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 217f0a0d-a9f2-4607-9643-5fcb3e34f20f --- .github/workflows/push_gem.yml | 7 +++++++ script/publish | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/.github/workflows/push_gem.yml b/.github/workflows/push_gem.yml index 55c12325a..2db5144b3 100644 --- a/.github/workflows/push_gem.yml +++ b/.github/workflows/push_gem.yml @@ -4,6 +4,12 @@ on: push: tags: - v* + workflow_dispatch: + inputs: + tag: + description: 'Tag to push to RubyGems (e.g. v4.14.0)' + required: true + type: string permissions: contents: read @@ -29,6 +35,7 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with: + ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }} persist-credentials: false - name: Set up Ruby uses: ruby/setup-ruby@v1 diff --git a/script/publish b/script/publish index 68d31e4fd..d37414475 100755 --- a/script/publish +++ b/script/publish @@ -71,3 +71,13 @@ gh release create "$tag" \ --title "$version" \ --notes "$changelog" \ --repo ViewComponent/view_component + +# Kick off the Push Gem workflow explicitly. GitHub Actions does not +# trigger downstream workflows for events driven by GITHUB_TOKEN — so +# the tag push above will not fire push_gem.yml on its own when this +# script runs inside the publish-release workflow. Dispatch it here so +# 'script/publish' always results in a gem being pushed to RubyGems. +gh workflow run push_gem.yml \ + --repo ViewComponent/view_component \ + --ref main \ + --field tag="$tag" || true