sourcegraph/.github/workflows/report-job-failure.yml
William Bezuidenhout 9d821b78b6
sentry action reporter: set the repo name in the event message (#59161)
* sentry report action: set repo name in event msg

* fail pr-auditor on purpose

* Revert "fail pr-auditor on purpose"
2023-12-21 12:17:58 +00:00

41 lines
1.3 KiB
YAML

on:
# When a reusable workflow is triggered by a caller workflow,
# the github context is always associated with the caller workflow.
workflow_call:
inputs:
repo:
required: false
type: string
default: ${{ github.repository }}
branch:
required: false
type: string
default: ${{ github.ref_name }}
workflow_name:
required: false
type: string
default: ${{ github.workflow }}
run_id:
required: false
type: string
default: ${{ github.run_id }}
jobs:
send_failure_event:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
- name: Send Sentry event for failed action
run: |
npm i -g @sentry/cli
sentry-cli send-event -m "A job in the ${{ inputs.workflow_name }} action for the repository '${{ inputs.repo }}' has failed - see run for exact failure" \
-t "github-action:${{ inputs.workflow_name }}" \
-t "branch:${{ inputs.branch }}" \
-t "repository:${{ inputs.repo }}" \
-t "workflow-run: https://github.com/${{ inputs.repo }}/actions/runs/${{ inputs.run_id }}" \
--no-environ
env:
SENTRY_DSN: ${{ secrets.SENTRY_DEV_INFRA_DSN }}
SENTRY_ORG: sourcegraph
SENTRY_PROJECT: dev-infra