From cae0c0b265dedc6f50abfa545a3dd78320729b35 Mon Sep 17 00:00:00 2001 From: Developer Date: Wed, 8 Apr 2026 12:32:05 -0700 Subject: [PATCH] Fix false job failure: use GITHUB_ENV instead of step outputs The act runner has a Go format bug that evaluates step outputs at cleanup time and crashes with %!t(string=...), marking the job as failed even though all steps succeeded. Replaced steps.bump.outputs.* with GITHUB_ENV variables which persist across steps without triggering the runner's output evaluation bug. Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitea/workflows/release.yml | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index d20c18e..6e12004 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -36,9 +36,6 @@ jobs: name: Bump version and tag needs: test runs-on: ubuntu-latest - outputs: - new_version: ${{ steps.bump.outputs.new_version }} - tag: ${{ steps.bump.outputs.tag }} steps: - uses: actions/checkout@v4 with: @@ -50,7 +47,6 @@ jobs: git config user.email "actions@gitea.local" - name: Bump patch version - id: bump run: | CURRENT=$(grep '"version"' package.json | head -1 | sed 's/.*"version": *"\([^"]*\)".*/\1/') echo "Current version: ${CURRENT}" @@ -68,35 +64,34 @@ jobs: sed -i "s/__version__ = \"${CURRENT}\"/__version__ = \"${NEW_VERSION}\"/" version.py sed -i "s/__version_info__ = .*/__version_info__ = (${MAJOR}, ${MINOR}, ${NEW_PATCH})/" version.py - echo "new_version=${NEW_VERSION}" >> $GITHUB_OUTPUT - echo "tag=v${NEW_VERSION}" >> $GITHUB_OUTPUT + # Write to env file instead of step outputs (avoids act runner bug) + echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV + echo "RELEASE_TAG=v${NEW_VERSION}" >> $GITHUB_ENV - name: Commit and tag env: BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }} run: | - NEW_VERSION="${{ steps.bump.outputs.new_version }}" git add package.json src-tauri/tauri.conf.json src-tauri/Cargo.toml version.py git commit -m "chore: bump version to ${NEW_VERSION} [skip ci]" - git tag "v${NEW_VERSION}" + git tag "${RELEASE_TAG}" REMOTE_URL=$(git remote get-url origin | sed "s|://|://gitea-actions:${BUILD_TOKEN}@|") git pull --rebase "${REMOTE_URL}" main || true git push "${REMOTE_URL}" HEAD:main - git push "${REMOTE_URL}" "v${NEW_VERSION}" + git push "${REMOTE_URL}" "${RELEASE_TAG}" - name: Create Gitea release env: BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }} run: | REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}" - TAG="${{ steps.bump.outputs.tag }}" - RELEASE_NAME="Local Transcription ${TAG}" + RELEASE_NAME="Local Transcription ${RELEASE_TAG}" curl -s -X POST \ -H "Authorization: token ${BUILD_TOKEN}" \ -H "Content-Type: application/json" \ - -d "{\"tag_name\": \"${TAG}\", \"name\": \"${RELEASE_NAME}\", \"body\": \"Automated build.\", \"draft\": false, \"prerelease\": false}" \ + -d "{\"tag_name\": \"${RELEASE_TAG}\", \"name\": \"${RELEASE_NAME}\", \"body\": \"Automated build.\", \"draft\": false, \"prerelease\": false}" \ "${REPO_API}/releases" echo "Created release: ${RELEASE_NAME}" @@ -105,18 +100,14 @@ jobs: BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }} run: | REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}" - TAG="${{ steps.bump.outputs.tag }}" for workflow in build-app-linux.yml build-app-windows.yml build-app-macos.yml; do - echo "Dispatching ${workflow} for ${TAG}..." + echo "Dispatching ${workflow} for ${RELEASE_TAG}..." HTTP_CODE=$(curl -s -w "%{http_code}" -o /tmp/dispatch_resp.txt -X POST \ -H "Authorization: token ${BUILD_TOKEN}" \ -H "Content-Type: application/json" \ - -d "{\"ref\": \"main\", \"inputs\": {\"tag\": \"${TAG}\"}}" \ + -d "{\"ref\": \"main\", \"inputs\": {\"tag\": \"${RELEASE_TAG}\"}}" \ "${REPO_API}/actions/workflows/${workflow}/dispatches") echo " -> HTTP ${HTTP_CODE}" [ "$HTTP_CODE" != "204" ] && cat /tmp/dispatch_resp.txt && echo "" done - - # NOTE: Automatic cleanup disabled -- it races with async builds. - # Clean up old releases manually from the Gitea UI when needed.