diff --git a/.github/workflows/labeled.yml b/.github/workflows/labeled.yml index 872ecebcda..a22a3a9456 100644 --- a/.github/workflows/labeled.yml +++ b/.github/workflows/labeled.yml @@ -33,10 +33,21 @@ jobs: run: | LABELS=$(bun scripts/read-issue.ts) echo "labels=$LABELS" >> $GITHUB_OUTPUT + bun scripts/is-outdated.ts - OUTDATED=$(bun scripts/is-outdated.ts) - echo "Is outdated: $OUTDATED" - echo "$OUTDATED" >> $GITHUB_OUTPUT + if [[ -f "is-outdated.txt" ]]; then + echo "is-outdated=true" >> $GITHUB_OUTPUT + fi + + if [[ -f "outdated.txt" ]]; then + echo "oudated=$(cat outdated.txt)" >> $GITHUB_OUTPUT + fi + + if [[ -f "latest.txt" ]]; then + echo "latest=$(cat latest.txt)" >> $GITHUB_OUTPUT + fi + + rm -rf is-outdated.txt outdated.txt latest.txt - name: Add labels uses: actions-cool/issues-helper@v3 with: @@ -52,7 +63,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.issue.number }} body: | - The latest version of Bun is v${{ steps.add-labels.outputs.latest }}, but you are using v${{ steps.add-labels.outputs.oudated }}. + @${{ github.event.issue.user.login }}, the latest version of Bun is v${{ steps.add-labels.outputs.latest }}, but you are using v${{ steps.add-labels.outputs.oudated }}. If you upgrade to the latest version, does this fix the issue? diff --git a/scripts/is-outdated.ts b/scripts/is-outdated.ts index baa7a45d76..1360b46781 100644 --- a/scripts/is-outdated.ts +++ b/scripts/is-outdated.ts @@ -30,7 +30,7 @@ const latest = await (async () => { return cmake.slice(quote + 1, endQuote); })(); -console.write("latest=" + latest); +await Bun.write("latest.txt", latest); const lines = body.split("\n").reverse(); for (const line of lines) { @@ -52,8 +52,8 @@ for (const line of lines) { } if (Bun.semver.order(latest, version) === 1) { - console.write(",outdated=" + version); - console.write(",is-outdated=true"); + await Bun.write("is-outdated.txt", "true"); + await Bun.write("outdated.txt", version); process.exit(0); } }