Skip to content

Commit

Permalink
list merges of last 24h on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Nov 11, 2022
1 parent fa9d0de commit e2055b7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,24 @@ commands:
when: always
command: |
echo 'export CURRENT_TEMPLATE=$(yarn get-template << pipeline.parameters.workflow >> ${CIRCLE_JOB})' >> "$BASH_ENV"
list-recent-merges:
description: 'Lists the merge commits from the past 24 hours'
steps:
- run:
name: Listing merge commits from the past 24 hours
when: always
command: |
echo 'export RECENT_MERGES=$(git log --merges --oneline --since="24 hours ago" --pretty=format:"%h %<(12)%ar | %s [%an]" | grep "Merge pull request")' >> "$BASH_ENV"
echo ${RECENT_MERGES}
report-workflow-on-failure:
description: 'Reports failures to discord'
steps:
- set-current-running-template
- list-recent-merges
- discord/status:
only_for_branches: chore/failure-reports
fail_only: true
failure_message: "Oh no! The **$CIRCLE_JOB** job has failed for ${CURRENT_TEMPLATE}"
failure_message: "Oh no! The **$CIRCLE_JOB** job has failed for **${CURRENT_TEMPLATE}**.\n Here are the merges of the last 24h:\n\n${RECENT_MERGES}"
jobs:
build:
executor:
Expand Down

0 comments on commit e2055b7

Please sign in to comment.