Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #22: Don't mark release as critical if it's less than a month old #33

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install PyGithub
pip install timeago
- name: Run script and commit changes
run: |
python release.py
Expand Down
15 changes: 12 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
---

{% assign org_href = "https://github.com/elementary" %}
{% assign now = 'now' | date: '%s' | plus: 0 %}

<table class="releases">
<thead>
Expand All @@ -16,6 +17,7 @@
{% unless site.data.blacklist contains repo.name %}
{% assign repo_href = org_href | append: "/" | append: repo.name %}
{% assign commits_href = repo_href | append: "/compare/" | append: repo.releases.first.version | append: "...master" %}
{% assign release_date_seconds = repo.releases.first.release_date | date: '%s' | plus: 0 %}
<tr id="{{ repo.name }}" >
<td class="release">
<a href="{{ repo_href }}" class="name">{{ repo.name }}</a>
Expand All @@ -28,23 +30,30 @@
<td class="status">
{% if repo.new_commits == 0 %}
<span class="badge good">Up to date</span>
{% elsif release_date_seconds > (now - 2419200) %}
<span class="badge good">
<a href="{{ commits_href }}">Recent Release</a>
</span>
{% elsif repo.new_commits == 1 %}
<span class="badge">
<a href="{{ commits_href }}">{{ repo.new_commits }} commit</a>
</span>
{% elsif repo.new_commits > 1 and repo.new_commits < 15 %}
{% elsif repo.new_commits <= 15 %}
<span class="badge">
<a href="{{ commits_href }}">{{ repo.new_commits }} commits</a>
</span>
{% elsif repo.new_commits >= 15 and repo.new_commits < 50 %}
{% elsif repo.new_commits <= 50 %}
<span class="badge warn">
<a href="{{ commits_href }}">{{ repo.new_commits }} commits</a>
</span>
{% elsif repo.new_commits >= 50 %}
{% else %}
<span class="badge critical">
<a href="{{ commits_href }}">{{ repo.new_commits }} commits</a>
</span>
{% endif %}
<sub class="timeago"><time datetime="{{ repo.releases.first.release_date }}">
{{ repo.releases.first.timeago }}
</time></sub>
</td>
</tr>
{% endunless %}
Expand Down
2 changes: 2 additions & 0 deletions release.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import datetime
import timeago
import json
import os
import sys
Expand Down Expand Up @@ -52,6 +53,7 @@ def __init__(self, repo):
releases.append ({
"version": release.tag_name,
"release_date": release.created_at.isoformat(),
"timeago": timeago.format(release.created_at, now),
"title": release.title,
"body": release.body,
"href": release.html_url
Expand Down