github-actions: report run failures to sentry (#59060)

* github-actions: report run failures to sentry

* report job name as well

* make buildchecker action consistent
This commit is contained in:
William Bezuidenhout 2023-12-18 18:06:50 +02:00 committed by GitHub
parent 73e3500f0d
commit 836271fddf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 70 additions and 2 deletions

View File

@ -27,11 +27,11 @@ jobs:
SLACK_ANNOUNCE_WEBHOOK: ${{ secrets.AUTOBUILDSHERRIF_SLACK_WEBHOOK }}
SLACK_DEBUG_WEBHOOK: ${{ secrets.AUTOBUILDSHERRIF_SLACK_DEBUG_WEBHOOK }}
SLACK_TOKEN: ${{ secrets.AUTOBUILDSHERRIF_SLACK_TOKEN }}
- name: report failure to sentry
- name: Report failure to sentry
if: ${{ failure() }}
run: |
npm i -g @sentry/cli
sentry-cli send-event -m 'buildchecker action failure - see run for exact failure' \
sentry-cli send-event -m "Job '$GITHUB_JOB' in the $GITHUB_WORKFLOW action has failed - see run for exact failure" \
-t "github-action:$GITHUB_WORKFLOW" \
-t "branch:$GITHUB_REF_NAME" \
-t "repository:$GITHUB_REPOSITORY" \

View File

@ -57,3 +57,17 @@ jobs:
token: ${{ secrets.GH_REPO_TOKEN }}
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
merge-method: squash
- name: Report failure to sentry
if: ${{ failure() }}
run: |
npm i -g @sentry/cli
sentry-cli send-event -m "Job '$GITHUB_JOB' in the $GITHUB_WORKFLOW action has failed - see run for exact failure" \
-t "github-action:$GITHUB_WORKFLOW" \
-t "branch:$GITHUB_REF_NAME" \
-t "repository:$GITHUB_REPOSITORY" \
-t "workflow-run:$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
env:
SENTRY_DSN: ${{ secrets.SENTRY_DEV_INFRA_DSN }}
SENTRY_ORG: sourcegraph
SENTRY_PROJECT: dev-infra

View File

@ -20,3 +20,16 @@ jobs:
GITHUB_EVENT_PATH: ${{ env.GITHUB_EVENT_PATH }}
GITHUB_TOKEN: ${{ secrets.PR_AUDITOR_TOKEN }}
GITHUB_RUN_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Report failure to sentry
if: ${{ failure() }}
run: |
npm i -g @sentry/cli
sentry-cli send-event -m "Job $GITHUB_JOB in the $GITHUB_WORKFLOW action has failed - see run for exact failure" \
-t "github-action:$GITHUB_WORKFLOW" \
-t "branch:$GITHUB_REF_NAME" \
-t "repository:$GITHUB_REPOSITORY" \
-t "workflow-run:$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
env:
SENTRY_DSN: ${{ secrets.SENTRY_DEV_INFRA_DSN }}
SENTRY_ORG: sourcegraph
SENTRY_PROJECT: dev-infra

View File

@ -125,3 +125,17 @@ jobs:
env:
repo: sourcegraph/sg
GITHUB_TOKEN: ${{ secrets.SG_RELEASE_TOKEN }}
- name: Report failure to sentry
if: ${{ failure() }}
run: |
npm i -g @sentry/cli
sentry-cli send-event -m "Job '$GITHUB_JOB' in the $GITHUB_WORKFLOW action has failed - see run for exact failure" \
-t "github-action:$GITHUB_WORKFLOW" \
-t "branch:$GITHUB_REF_NAME" \
-t "repository:$GITHUB_REPOSITORY" \
-t "workflow-run:$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
env:
SENTRY_DSN: ${{ secrets.SENTRY_DEV_INFRA_DSN }}
SENTRY_ORG: sourcegraph
SENTRY_PROJECT: dev-infra

View File

@ -10,3 +10,17 @@ jobs:
- uses: docker://sourcegraph/tracking-issue:latest
env:
GITHUB_TOKEN: ${{ secrets.TRACKING_ISSUE_SYNCER_TOKEN_DEVX_BOT }}
- name: Report failure to sentry
if: ${{ failure() }}
run: |
npm i -g @sentry/cli
sentry-cli send-event -m "Job '$GITHUB_JOB' in the $GITHUB_WORKFLOW action has failed - see run for exact failure" \
-t "github-action:$GITHUB_WORKFLOW" \
-t "branch:$GITHUB_REF_NAME" \
-t "repository:$GITHUB_REPOSITORY" \
-t "workflow-run:$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
env:
SENTRY_DSN: ${{ secrets.SENTRY_DEV_INFRA_DSN }}
SENTRY_ORG: sourcegraph
SENTRY_PROJECT: dev-infra

View File

@ -122,3 +122,16 @@ jobs:
path: './dist/'
destination: 'universal_ctags/x86_64-linux'
glob: 'universal-ctags-*'
- name: Report failure to sentry
if: ${{ failure() }}
run: |
npm i -g @sentry/cli
sentry-cli send-event -m "Job '$GITHUB_JOB' in the $GITHUB_WORKFLOW action has failed - see run for exact failure" \
-t "github-action:$GITHUB_WORKFLOW" \
-t "branch:$GITHUB_REF_NAME" \
-t "repository:$GITHUB_REPOSITORY" \
-t "workflow-run:$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
env:
SENTRY_DSN: ${{ secrets.SENTRY_DEV_INFRA_DSN }}
SENTRY_ORG: sourcegraph
SENTRY_PROJECT: dev-infra