From 14619df2ccdfdbfd9368524d1cdcdd9c125ff56a Mon Sep 17 00:00:00 2001 From: Jonathan <57915702+solidsnakedev@users.noreply.github.com> Date: Sun, 17 May 2026 22:25:04 +0000 Subject: [PATCH] fix(ci): switch GITHUB_OUTPUT to GITHUB_ENV and isolate npm install Two bugs fixed in post-release-to-x workflow: 1. Mode B: Replace steps.releases.outputs.found (GITHUB_OUTPUT) with env.HAS_RELEASES (GITHUB_ENV). The output-based approach was silently corrupting the value inside the multi-line run block, causing all downstream if: conditions to skip. 2. Mode C: Run npm install twitter-api-v2 in an isolated temp dir instead of the monorepo root to avoid peer dependency conflicts (e.g. @effect/docgen requiring typescript@^5.2.2 vs project using typescript@^6.0.3). --- .github/workflows/post-release-to-x.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/post-release-to-x.yml b/.github/workflows/post-release-to-x.yml index 3a2a2278..e8306dd2 100644 --- a/.github/workflows/post-release-to-x.yml +++ b/.github/workflows/post-release-to-x.yml @@ -69,23 +69,23 @@ jobs: fi done - echo "found=$FOUND" >> $GITHUB_OUTPUT - echo "url=$URL" >> $GITHUB_OUTPUT + echo "HAS_RELEASES=$FOUND" >> $GITHUB_ENV + echo "RELEASE_URL=$URL" >> $GITHUB_ENV env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Setup Node.js - if: steps.releases.outputs.found == 'true' + if: env.HAS_RELEASES == 'true' uses: actions/setup-node@v6.4.0 with: node-version: "22" - name: Generate tweets with AI - if: steps.releases.outputs.found == 'true' + if: env.HAS_RELEASES == 'true' id: ai run: | RESULT=$(RELEASE_NOTES="$(cat /tmp/release-notes.md)" \ - RELEASE_URL="${{ steps.releases.outputs.url }}" \ + RELEASE_URL="${{ env.RELEASE_URL }}" \ GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}" \ node .github/scripts/generate-release-tweet.mjs) { @@ -95,11 +95,14 @@ jobs: } >> "$GITHUB_OUTPUT" - name: Post thread to X - if: steps.releases.outputs.found == 'true' + if: env.HAS_RELEASES == 'true' run: | + # Install in isolated dir to avoid peer dep conflicts with monorepo root + mkdir -p /tmp/tweet-lib && cd /tmp/tweet-lib + npm init -y --silent npm install twitter-api-v2@1 node -e " - const { TwitterApi } = require('twitter-api-v2'); + const { TwitterApi } = require('/tmp/tweet-lib/node_modules/twitter-api-v2'); const client = new TwitterApi({ appKey: process.env.TWITTER_API_KEY,