From cbf6f260f48334f305f6eefc5f128d96fb97fc57 Mon Sep 17 00:00:00 2001 From: Leandro Beretta Date: Tue, 15 Sep 2026 12:38:30 -0300 Subject: [PATCH] Fix the PR image comment job Since 12fc3df7 split the workflow into separate jobs, the comment job calls fs.readFileSync() without requiring 'fs' and no longer downloads the artifact holding ./commands-url, so it fails with "ReferenceError: fs is not defined". The image is pushed but no comment is posted, so PR authors and QE never get the image tag and fall back to :main. Read the URL in the push job, which already has the artifact, and pass it to the comment job as an output. Co-Authored-By: Claude Opus 5 --- .github/workflows/push_image_pr.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push_image_pr.yml b/.github/workflows/push_image_pr.yml index 3db9c3e9e..cbebb36a0 100644 --- a/.github/workflows/push_image_pr.yml +++ b/.github/workflows/push_image_pr.yml @@ -52,6 +52,8 @@ jobs: needs: extract-data name: push PR image runs-on: ubuntu-latest + outputs: + commands_url: ${{ steps.commands-url.outputs.commands_url }} steps: - name: download artifact uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 @@ -59,6 +61,9 @@ jobs: name: pr run-id: ${{ github.event.workflow_run.id }} github-token: ${{ secrets.GITHUB_TOKEN }} + - name: read commands URL + id: commands-url + run: echo "commands_url=$(cat ./commands-url)" >> $GITHUB_OUTPUT - name: load images env: MAIN_IMAGE: ${{ needs.extract-data.outputs.main_image }} @@ -88,12 +93,13 @@ jobs: MAIN_IMAGE: ${{ needs.extract-data.outputs.main_image }} SHORT_SHA: ${{ needs.extract-data.outputs.short_sha }} PR_ID: ${{ needs.extract-data.outputs.pr_id }} + COMMANDS_URL: ${{ needs.push.outputs.commands_url }} with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | const mainImage = process.env.MAIN_IMAGE; const shortSHA = process.env.SHORT_SHA; - const commandsURL = fs.readFileSync('./commands-url'); + const commandsURL = process.env.COMMANDS_URL; github.rest.issues.createComment({ issue_number: parseInt(process.env.PR_ID, 10), owner: context.repo.owner,