Skip to content

Commit d1fd891

Browse files
authored
Merge pull request #2702 from ViewComponent/joelhawksley-redesigned-sniffle
Trigger push_gem from script/publish and allow manual dispatch
2 parents b7094df + a7c846d commit d1fd891

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

‎.github/workflows/push_gem.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ on:
44
push:
55
tags:
66
- v*
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'Tag to push to RubyGems (e.g. v4.14.0)'
11+
required: true
12+
type: string
713

814
permissions:
915
contents: read
@@ -29,6 +35,7 @@ jobs:
2935

3036
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
3137
with:
38+
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }}
3239
persist-credentials: false
3340
- name: Set up Ruby
3441
uses: ruby/setup-ruby@v1

‎script/publish‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,13 @@ gh release create "$tag" \
7171
--title "$version" \
7272
--notes "$changelog" \
7373
--repo ViewComponent/view_component
74+
75+
# Kick off the Push Gem workflow explicitly. GitHub Actions does not
76+
# trigger downstream workflows for events driven by GITHUB_TOKEN — so
77+
# the tag push above will not fire push_gem.yml on its own when this
78+
# script runs inside the publish-release workflow. Dispatch it here so
79+
# 'script/publish' always results in a gem being pushed to RubyGems.
80+
gh workflow run push_gem.yml \
81+
--repo ViewComponent/view_component \
82+
--ref main \
83+
--field tag="$tag" || true

0 commit comments

Comments
 (0)