Skip to content

Commit

Permalink
feat: added cancelled event (#64)
Browse files Browse the repository at this point in the history
* Handle cancelled jobs (ie timeouts)

* fix: remove dist from gitignore

* fix: added changes for cancelled event

* ci: added git config details in test ci

* ci: fixed push command for pull request

* ci: added ref while pushing to pull request

* ci: dump git context

* ci: refer to pull request head ref

* chore: updated dist with new code

Co-authored-by: Erez Arnon <[email protected]>
Co-authored-by: Github Actions <[email protected]>
  • Loading branch information
3 people authored Sep 17, 2022
1 parent b0daf47 commit 9fcde3a
Show file tree
Hide file tree
Showing 7 changed files with 706 additions and 11 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/test-and-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ jobs:

- name: Commit if dist has changed
run: |
echo "${{ toJson(github) }}"
git config user.name "Github Actions"
git config user.email [email protected]
if [ $(git status dist --porcelain=v1 2>/dev/null | wc -l) != "0" ]; then
git add dist
git commit -m "chore: updated dist with new code"
git push origin HEAD --force
git push origin HEAD:${{ github.event.pull_request.head.ref }} --force
fi
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ footer:
notify_when:
description: Specify on which events a slack notification is sent
required: false
default: "success,failure,warnings"
default: "success,failure,cancelled,warnings"
mention_users:
description: Specify the slack IDs of users you want to mention.
Expand All @@ -183,7 +183,7 @@ mention_users:
mention_users_when:
description: Specify on which events you want to mention the users
required: false
default: "success,failure,warnings"
default: "success,failure,cancelled,warnings"
mention_groups:
description: Specify the slack IDs of groups you want to mention
Expand All @@ -193,7 +193,7 @@ mention_groups:
mention_groups_when:
description: Specify on which events you want to mention the groups
required: false
default: "success,failure,warnings"
default: "success,failure,cancelled,warnings"
icon_success:
description: Specify on icon to be used when event is success
Expand All @@ -205,6 +205,11 @@ icon_failure:
required: false
default: ":x:"
icon_cancelled:
description: Specify on icon to be used when event is cancelled
required: false
default: ":x:"
icon_warnings:
description: Specify on icon to be used when event is warnings
required: false
Expand Down
10 changes: 7 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ inputs:
notify_when:
description: Specify on which events a slack notification is sent
required: false
default: "success,failure,warnings"
default: "success,failure,cancelled,warnings"
mention_users:
description: Specify the slack IDs of users you want to mention
required: false
default: ""
mention_users_when:
description: Specify on which events you want to mention the users
required: false
default: "success,failure,warnings"
default: "success,failure,cancelled,warnings"
mention_groups:
description: Specify the slack IDs of groups you want to mention
required: false
default: ""
mention_groups_when:
description: Specify on which events you want to mention the groups
required: false
default: "success,failure,warnings"
default: "success,failure,cancelled,warnings"
icon_success:
description: Specify on icon to be used when event is success
required: false
Expand All @@ -49,6 +49,10 @@ inputs:
description: Specify on icon to be used when event is failure
required: false
default: ":x:"
icon_cancelled:
description: Specify on icon to be used when event is cancelled
required: false
default: ":x:"
icon_warnings:
description: Specify on icon to be used when event is warnings
required: false
Expand Down
672 changes: 670 additions & 2 deletions dist/index.js

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions dist/licenses.txt
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,19 @@ Permission to use, copy, modify, and/or distribute this software for any purpose
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.


uuid
MIT
The MIT License (MIT)

Copyright (c) 2010-2020 Robert Kieffer and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


webidl-conversions
BSD-2-Clause
# The BSD 2-Clause License
Expand Down
5 changes: 4 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,26 @@ import { getInput, setFailed } from "@actions/core"
import { context } from "@actions/github"
import fetch from "node-fetch"

type JobStatus = "success" | "failure" | "warning"
type JobStatus = "success" | "failure" | "cancelled" | "warning"

const actionColor = (status: JobStatus) => {
if (status === "success") return "good"
if (status === "failure") return "danger"
if (status === "cancelled") return "danger"
return "warning"
}

const actionStatus = (status: JobStatus) => {
if (status === "success") return "passed"
if (status === "failure") return "failed"
if (status === "cancelled") return "cancelled"
return "passed with warnings"
}

const actionEmoji = (status: JobStatus) => {
if (status === "success") return getInput("icon_success")
if (status === "failure") return getInput("icon_failure")
if (status === "cancelled") return getInput("icon_cancelled")
return getInput("icon_warnings")
}

Expand Down

0 comments on commit 9fcde3a

Please sign in to comment.