Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,19 @@ jobs:
release-type: rust
package-name: rtk

build-release:
name: Build and upload release assets
needs: release-please
if: ${{ needs.release-please.outputs.release_created == 'true' }}
uses: ./.github/workflows/release.yml
with:
tag: ${{ needs.release-please.outputs.tag_name }}
permissions:
contents: write

update-latest-tag:
name: Update 'latest' tag
needs: release-please
needs: [release-please, build-release]
if: ${{ needs.release-please.outputs.release_created == 'true' }}
runs-on: ubuntu-latest
steps:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name: Release
on:
release:
types: [published]
workflow_call:
inputs:
tag:
description: 'Tag to release'
required: true
type: string
Comment on lines +6 to +11

Copilot AI Feb 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow_call trigger is defined correctly, but the implementation is incomplete. When this workflow is called via workflow_call, the checkout actions throughout the workflow (at lines 54, 96, 119, and 146) will default to checking out the branch that triggered the caller workflow (master), not the tag that was just created.

All checkout actions need to add a ref parameter that uses the tag input when workflow_call is the event type. For example:

- name: Checkout
  uses: actions/checkout@v4
  with:
    ref: refs/tags/${{ inputs.tag }}

Note: You'll need to make the ref conditional based on the event type, or use a default that works for all cases.

Copilot uses AI. Check for mistakes.
workflow_dispatch:
inputs:
tag:
Expand Down Expand Up @@ -149,6 +155,8 @@ jobs:
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "version=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
elif [ "${{ github.event_name }}" = "workflow_call" ]; then
echo "version=${{ inputs.tag }}" >> $GITHUB_OUTPUT
elif [ "${{ github.event_name }}" = "release" ]; then
echo "version=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
fi
Expand All @@ -174,7 +182,7 @@ jobs:
sha256sum * > checksums.txt

- name: Upload Release Assets
if: github.event_name == 'release'
if: github.event_name == 'release' || github.event_name == 'workflow_call'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.version }}
Expand Down
Loading