-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Switch action to composite run * Update README
- Loading branch information
1 parent
365f961
commit 3a2fcc7
Showing
6 changed files
with
39 additions
and
84 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
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
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,15 +1,38 @@ | ||
name: 'Workflow Status Action' | ||
description: 'Trigger events like notifications or alerts using the workflow status' | ||
author: 'David Boenig <martialonline>' | ||
name: "Workflow Status Action" | ||
description: "Trigger events like notifications or alerts using the workflow status" | ||
author: "David Boenig <martialonline>" | ||
|
||
outputs: | ||
status: | ||
description: 'Returns either success or failed as workflow status' | ||
description: "Returns either success or failed as workflow status" | ||
value: ${{ steps.workflow-status.outputs.status }} | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
env: | ||
DOCKER_BUILDKIT: '1' | ||
using: "composite" | ||
steps: | ||
- id: workflow-status | ||
run: | | ||
url="${GITHUB_API_URL}/repos" | ||
repo="${GITHUB_REPOSITORY}" | ||
run_id="${GITHUB_RUN_ID}" | ||
failure=$(curl -s "${url}/${repo}/actions/runs/${run_id}/jobs" | \ | ||
jq -r '.jobs[] | select(.status == "completed" and .conclusion == "failure").conclusion' | \ | ||
wc -l) | ||
cancelled=$(curl -s "${url}/${repo}/actions/runs/${run_id}/jobs" | \ | ||
jq -r '.jobs[] | select(.status == "completed" and .conclusion == "cancelled").conclusion' | \ | ||
wc -l) | ||
if [ "${failure}" -gt 0 ]; then | ||
status="failure" | ||
elif [ "${cancelled}" -gt 0 ]; then | ||
status="cancelled" | ||
else | ||
status="success" | ||
fi | ||
echo "::set-output name=status::${status}" | ||
shell: bash | ||
branding: | ||
icon: check-square | ||
color: gray-dark |
This file was deleted.
Oops, something went wrong.