From 0c3bc8c48ee5daabce6b1c30e4e7c4ab478bce63 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Mon, 12 Jan 2026 20:31:18 +0000 Subject: [PATCH] fix(changelog-preview): Replace deleted install sub-action with inline install The install/ sub-action was removed in #705, breaking the changelog-preview workflow which still referenced getsentry/craft/install@master. Replace it with inline install logic that downloads from release: - Respects craft-version input (defaults to latest) - Falls back to latest if specified version not found - Adds robust error handling with set -euo pipefail - Verifies download succeeded and binary is valid - Runs craft --version to confirm installation Note: Dogfooding (using build artifact from PRs) is not implemented because: - Build workflow runs separately with workflow-scoped artifacts - Cross-workflow artifact fetching adds complexity - Changelog preview is less critical than main release action We always use released versions for changelog previews. --- .github/workflows/changelog-preview.yml | 49 +++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/.github/workflows/changelog-preview.yml b/.github/workflows/changelog-preview.yml index c4de71cc..ba8d93cc 100644 --- a/.github/workflows/changelog-preview.yml +++ b/.github/workflows/changelog-preview.yml @@ -52,11 +52,52 @@ jobs: with: fetch-depth: 0 - # Install Craft using the shared install action + # Install Craft from release + # Note: Dogfooding (using build artifact from this PR) is not feasible here because: + # 1. The build workflow runs separately and artifacts are scoped to that workflow run + # 2. Cross-workflow artifact fetching would require additional complexity + # 3. The changelog preview is less critical than the main release action + # For now, we always use the released version for changelog previews. - name: Install Craft - uses: getsentry/craft/install@master - with: - craft-version: ${{ inputs.craft-version || 'latest' }} + shell: bash + run: | + set -euo pipefail + + CRAFT_VERSION="${{ inputs.craft-version || 'latest' }}" + + if [[ "$CRAFT_VERSION" == "latest" || -z "$CRAFT_VERSION" ]]; then + echo "Downloading latest Craft release..." + CRAFT_URL=$(curl -fsSL "https://api.github.com/repos/getsentry/craft/releases/latest" \ + | jq -r '.assets[] | select(.name == "craft") | .browser_download_url') + else + CRAFT_URL="https://github.com/getsentry/craft/releases/download/${CRAFT_VERSION}/craft" + echo "Downloading Craft ${CRAFT_VERSION}..." + + # Fallback to latest if specified version doesn't exist + if ! curl -sfI "$CRAFT_URL" >/dev/null 2>&1; then + echo "Release not found for version '${CRAFT_VERSION}', falling back to latest..." + CRAFT_URL=$(curl -fsSL "https://api.github.com/repos/getsentry/craft/releases/latest" \ + | jq -r '.assets[] | select(.name == "craft") | .browser_download_url') + fi + fi + + # Verify we have a valid URL + if [[ -z "$CRAFT_URL" ]]; then + echo "::error::Failed to determine Craft download URL" + exit 1 + fi + + echo "Installing Craft from: ${CRAFT_URL}" + sudo curl -fsSL -o /usr/local/bin/craft "$CRAFT_URL" + sudo chmod +x /usr/local/bin/craft + + # Verify installation + if [[ ! -s /usr/local/bin/craft ]]; then + echo "::error::Downloaded Craft binary is empty or missing" + exit 1 + fi + + craft --version - name: Generate Changelog Preview shell: bash