-
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.
AAE-17087 new action + improvement in slack action
- Loading branch information
1 parent
1051d3e
commit c00f006
Showing
4 changed files
with
36 additions
and
22 deletions.
There are no files selected for viewing
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,35 @@ | ||
name: send a exceeded build time notification | ||
description: Sends slack notification if build took more than planned | ||
|
||
inputs: | ||
max-build-time: | ||
description: "Maximum acceptable build time in seconds" | ||
required: true | ||
slack-token: | ||
description: The slack bot token | ||
required: true | ||
slack-channel: | ||
description: The slack channel | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Fetch billable time from gh API | ||
id: fetch_time | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
total_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: steps.fetch_time.outputs.total_time > ${{inputs.max-build-time}} | ||
uses: Alfresco/alfresco-build-tools/.github/actions/[email protected] | ||
with: | ||
channel-id: ${{ inputs.slack-channel }} | ||
message: 'build time took ${{steps.fetch_time.outputs.total_time}} seconds when expected ${{inputs.max-build-time}} seconds' | ||
token: ${{ inputs.slack-token }} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -79,6 +79,7 @@ runs: | |
|
||
- name: Send slack notification | ||
id: slack | ||
if: ${{ inputs.token != '' }} | ||
uses: slackapi/[email protected] | ||
env: | ||
SLACK_BOT_TOKEN: ${{ inputs.token }} | ||
|
This file was deleted.
Oops, something went wrong.