Skip to content

Commit d980706

Browse files
authored
Merge pull request #5 from ipdxco/unsuccessful-only
feat: add unsuccessful only template
2 parents cf93e11 + da09598 commit d980706

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## Unreleased
88

9+
## [1.0.2] - 2024-04-09
10+
### Added
11+
- Added the `unsuccessful_only` template
12+
913
## [1.0.1] - 2024-04-09
1014
### Fixed
1115
- Templates can now be rendered even if a check is not related to a workflow run

templates/unsuccessful_only.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<%
2+
if (checks.some(({status}) => status !== 'completed')) {
3+
%>
4+
Some checks haven't completed yet<%
5+
} else {
6+
if (checks.every(({conclusion}) => conclusion === 'success')) {
7+
%>
8+
All checks have passed<%
9+
} else {
10+
%>
11+
All checks have completed
12+
<%
13+
}
14+
const sorted = _.sortBy(checks, ['conclusion', 'status', 'workflow_run.name', 'name', 'workflow_run.event'])
15+
_.forEach(sorted, (check) => {
16+
const result = check.conclusion || check.status
17+
if (result !== 'success') {
18+
%>
19+
<%= emojis[result] %> <%= descriptions[result] %> [<%= check?.workflow_run?.name || 'Unknown' %> / <%= check.name %> (<%= check?.workflow_run?.event || 'unknown' %>)](<%= check.details_url %>) <%
20+
}
21+
})
22+
}%>

0 commit comments

Comments
 (0)