# Generated by uie-fullsend langfuse-setup. Uses trusted default-branch code. name: Fullsend Langfuse on: workflow_run: workflows: [fullsend] types: [completed] workflow_dispatch: inputs: trace_id: description: OTLP trace ID for verification (32 hexadecimal characters) required: true type: string permissions: actions: read contents: read concurrency: group: langfuse-${{ github.event.workflow_run.id || github.run_id }}-${{ github.event.workflow_run.run_attempt || github.run_attempt }} cancel-in-progress: false jobs: generation: runs-on: ubuntu-24.04 timeout-minutes: 10 steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.event.repository.default_branch }} persist-credentials: false - name: Download Fullsend output as data if: github.event_name == 'workflow_run' id: artifacts env: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} RUN_ID: ${{ github.event.workflow_run.id }} run: | artifact_names="$(gh api --paginate "repos/$GH_REPO/actions/runs/$RUN_ID/artifacts?per_page=100" --jq '.artifacts[].name | select(startswith("fullsend-"))')" if [ -z "$artifact_names" ]; then echo "No Fullsend artifacts were published by run $RUN_ID; skipping trace export." echo "found=false" >> "$GITHUB_OUTPUT" exit 0 fi if ! gh run download "$RUN_ID" --pattern 'fullsend-*' --dir "$RUNNER_TEMP/langfuse-artifacts"; then echo "::error::Failed to download Fullsend artifacts from run $RUN_ID." exit 1 fi echo "found=true" >> "$GITHUB_OUTPUT" - name: Export Langfuse trace if: github.event_name == 'workflow_dispatch' || steps.artifacts.outputs.found == 'true' env: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: ${{ vars.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT }} OTEL_EXPORTER_OTLP_TRACES_HEADERS: ${{ secrets.OTEL_EXPORTER_OTLP_TRACES_HEADERS }} OTEL_RESOURCE_ATTRIBUTES: ${{ vars.OTEL_RESOURCE_ATTRIBUTES }} SOURCE_RUN_ID: ${{ github.event.workflow_run.id || github.run_id }} SOURCE_RUN_ATTEMPT: ${{ github.event.workflow_run.run_attempt || github.run_attempt }} SOURCE_ACTOR: ${{ github.event.workflow_run.actor.login || github.actor }} VERIFY_TRACE_ID: ${{ inputs.trace_id }} EVENT_NAME: ${{ github.event_name }} run: | if [ "$EVENT_NAME" = workflow_dispatch ]; then python3 .fullsend/scripts/langfuse-post-run.py --verify-trace-id "$VERIFY_TRACE_ID" else python3 .fullsend/scripts/langfuse-post-run.py "$RUNNER_TEMP/langfuse-artifacts" fi