diff --git a/.github/workflows/push_gem.yml b/.github/workflows/push_gem.yml index 2db5144b3..8d5278535 100644 --- a/.github/workflows/push_gem.yml +++ b/.github/workflows/push_gem.yml @@ -5,11 +5,6 @@ on: tags: - v* workflow_dispatch: - inputs: - tag: - description: 'Tag to push to RubyGems (e.g. v4.14.0)' - required: true - type: string permissions: contents: read @@ -35,7 +30,6 @@ 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 d37414475..ba9da58be 100755 --- a/script/publish +++ b/script/publish @@ -77,7 +77,9 @@ gh release create "$tag" \ # 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. +# +# Dispatch against the tag ref (not main) because the 'release' +# environment restricts deployments to v* tags. gh workflow run push_gem.yml \ --repo ViewComponent/view_component \ - --ref main \ - --field tag="$tag" || true + --ref "$tag" || true