Access Wrangler command output and error logs
mainYou can capture the output of the Wrangler command to use in subsequent GitHub Action steps using the following output variables:
command-output: The standard output (stdout) of the Wrangler command.command-stderr: The standard error (stderr) of the Wrangler command.
To use them, ensure you assign an id to the wrangler-action step.
- name: Deploy
id: deploy
uses: cloudflare/wrangler-action@v4
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy --project-name=example
- name: print wrangler command output
env:
CMD_OUTPUT: ${{ steps.deploy.outputs.command-output }}
run: echo $CMD_OUTPUT