-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Anahide Tchertchian <[email protected]> Co-authored-by: Giovanni Toraldo <[email protected]>
- Loading branch information
1 parent
fe3ae25
commit 7d8cfaa
Showing
3 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
.github/actions/send-slack-notification-slow-job/action.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Send a notification for exceeded build time | ||
description: Send a slack notification if build took more than planned | ||
|
||
inputs: | ||
max-build-time-seconds: | ||
description: Maximum acceptable build time in seconds | ||
required: true | ||
slack-token: | ||
description: The slack token | ||
required: true | ||
slack-channel: | ||
description: The slack channel id, channel name, or user id to post to | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Fetch billable time from gh API | ||
id: fetch_time | ||
shell: bash | ||
run: | | ||
total_time=$(gh api /repos/${{github.repository}}/actions/runs/${{github.run_id}}/timing | jq ' .billable.UBUNTU.total_ms /1000') | ||
echo "total_time in seconds: ${total_time}" | ||
echo "total_time=${total_time}" >> $GITHUB_OUTPUT | ||
- name: Slack Notification | ||
if: fromJSON(steps.fetch_time.outputs.total_time) > fromJSON(inputs.max-build-time-seconds) | ||
uses: Alfresco/alfresco-build-tools/.github/actions/[email protected] | ||
with: | ||
channel-id: ${{ inputs.slack-channel }} | ||
message: 'Max build time exceeded: took ${{ steps.fetch_time.outputs.total_time }} seconds (expected max: ${{ inputs.max-build-time-seconds }} seconds)' | ||
token: ${{ inputs.slack-token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v3.4.1 | ||
v3.5.0 |