Skip to content

Commit 1cf0760

Browse files
committed
2 parents 35bb91a + 6f0fcf0 commit 1cf0760

File tree

4 files changed

+2562
-18
lines changed

4 files changed

+2562
-18
lines changed

.github/workflows/coverage.yml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,34 @@
11
name: Post coverage comment
2-
32
on:
43
workflow_run:
54
workflows: ["UnitTests"]
65
types:
76
- completed
8-
workflow_dispatch:
97

108
jobs:
119
test:
1210
name: Run tests & display coverage
1311
runs-on: ubuntu-latest
14-
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
1512
permissions:
16-
# Gives the action the necessary permissions for publishing new
17-
# comments in pull requests.
1813
pull-requests: write
19-
# Gives the action the necessary permissions for editing existing
20-
# comments (to avoid publishing multiple comments in the same PR)
2114
contents: write
22-
# Gives the action the necessary permissions for looking up the
23-
# workflow that launched this workflow, and download the related
24-
# artifact that contains the comment to be published
2515
actions: read
2616
steps:
27-
# DO NOT run actions/checkout here, for security reasons
28-
# For details, refer to https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
17+
- name: Check if should run
18+
id: check
19+
run: |
20+
if [[ "${{ github.event.workflow_run.event }}" == "pull_request" ]] && [[ "${{ github.event.workflow_run.conclusion }}" == "success" ]]; then
21+
echo "should_run=true" >> $GITHUB_OUTPUT
22+
echo "✅ Running coverage comment for PR"
23+
else
24+
echo "should_run=false" >> $GITHUB_OUTPUT
25+
echo "✅ Skipping - not a PR event (event: ${{ github.event.workflow_run.event }})"
26+
fi
27+
2928
- name: Post comment
29+
if: steps.check.outputs.should_run == 'true'
3030
uses: py-cov-action/python-coverage-comment-action@v3
3131
with:
32-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3332
GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }}
34-
# Update those if you changed the default values:
35-
# COMMENT_ARTIFACT_NAME: python-coverage-comment-action
36-
# COMMENT_FILENAME: python-coverage-comment-action.txt
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

Procfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Procfile
2-
web: python src/discord-cluster-manager/bot.py
2+
web: PYTHONPATH=/app/src python src/kernelbot/main.py

src/libkernelbot/leaderboard_db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def create_submission_run(
398398
def get_leaderboard_names(self, active_only: bool = False) -> list[str]:
399399
if active_only:
400400
self.cursor.execute(
401-
"SELECT name FROM leaderboard.leaderboard WHERE leaderboard.deadline < %s",
401+
"SELECT name FROM leaderboard.leaderboard WHERE leaderboard.deadline > %s",
402402
(datetime.datetime.now().astimezone(datetime.timezone.utc),),
403403
)
404404
else:

0 commit comments

Comments
 (0)