Skip to content

Commit

Permalink
Better messages in slack-message-broker.yml (#6280)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeme-wana authored Jul 2, 2024
1 parent cabfc01 commit cb791cd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ on:
jobs:
Send:
runs-on: [ubuntu-latest]
# if: contains(fromJson('["success", "failure", "null", "skipped", "cancelled", "action_required", "neutral", "timed_out"]'), github.event.workflow_run.conclusion)
steps:
- name: Prepare Slack Message
uses: actions/github-script@main
Expand All @@ -29,10 +28,25 @@ jobs:
const name = "${{ github.event.workflow_run.name }}";
const url = "${{ github.event.workflow_run.html_url }}";
const status = "${{ github.event.workflow_run.status }}";
const action = "${{ github.event.action }}";
const conclusion = "${{ github.event.workflow_run.conclusion }}";
const message = `Workflow '${name}' \`${action}\`: \`${status}\`, \`${conclusion}\`, <${url}|View Logs>`;
console.log(message)
const failure_conclusions = [ "failure", "null", "cancelled", "action_required", "neutral", "timed_out" ];
let message = "";
if (conclusion == "") {
message = `${name} \`${status}\` ⏳ <${url}|View Logs>`;
}
else if (conclusion == "success") {
message = `${name} \`${conclusion}\` ✅ <${url}|View Logs>`;
}
else if (conclusion == "skipped") {
message = `${name} \`${conclusion}\` ⏩ <${url}|View Logs>`;
}
else if (failure_conclusions.includes(conclusion)) {
message = `${name} \`${conclusion}\` ❌ <${url}|View Logs> @channel`;
}
else {
message = `${name} \`${conclusion}\` ⁉️ <${url}|View Logs> Unknown Conclusion @channel`;
}
console.log(message);
core.setOutput("message", message);
- name: Notify Slack
Expand Down
2 changes: 1 addition & 1 deletion scripts/combined-haddock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ echo "Looking for linkchecker"
if ! command -v linkchecker &> /dev/null; then
echo "linkchecker not found"
exit 0
done
fi


echo "Running linkchecker"
Expand Down

0 comments on commit cb791cd

Please sign in to comment.