Skip to content
Open
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
52 changes: 0 additions & 52 deletions .github/workflows/publish-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,55 +214,3 @@ jobs:
run: |
pnpm seed publish cli --ver ${{ inputs.version }} --log-level debug
pnpm seed register cli

bulk-update-cli:
runs-on: ubuntu-latest
needs: [prod, manual]
if: ${{ always() && (needs.prod.result == 'success' || needs.manual.result == 'success') }}
env:
# Autopilot host URL (should include scheme, e.g., https://autopilot.example.com)
AUTOPILOT_HOST: ${{ vars.AUTOPILOT_HOST != '' && vars.AUTOPILOT_HOST || 'https://autopilot.buildwithfern.com' }}
steps:
- name: Checkout repo
uses: actions/checkout@v6

- name: Get CLI version
id: get_version
run: |
if [ -n "${{ inputs.version }}" ]; then
# Manual publish - use the input version
echo "CLI_VERSION=${{ inputs.version }}" >> $GITHUB_OUTPUT
else
# Automatic publish - extract from versions.yml
version=$(head -n 20 packages/cli/cli/versions.yml | grep -m 1 "version:" | awk '{print $3}')
echo "CLI_VERSION=${version}" >> $GITHUB_OUTPUT
fi

- name: Trigger bulk update
env:
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
run: |
version="${{ steps.get_version.outputs.CLI_VERSION }}"
host="${AUTOPILOT_HOST%/}"
echo "Using autopilot host: ${host}"
echo "Triggering bulk update for CLI version: ${version}"

response=$(curl -s -w "\n%{http_code}" -X POST \
"${host}/api/bulk-update-cli" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${FERN_TOKEN}" \
-d "{\"newVersion\": \"latest\", \"changeMode\": \"pull-request\"}")

http_code=$(echo "$response" | tail -n 1)
body=$(echo "$response" | sed '$d')

echo "Response status: ${http_code}"
echo "Response body: ${body}"

if [ "$http_code" -ge 200 ] && [ "$http_code" -lt 300 ]; then
echo "✓ Bulk update triggered successfully"
exit 0
else
echo "✗ Bulk update failed with status ${http_code}"
exit 1
fi
Loading