Skip to content
Draft
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
7 changes: 6 additions & 1 deletion .github/workflows/taskbounty-scout.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ jobs:
TASKBOUNTY_API_KEY: ${{ secrets.TASKBOUNTY_API_KEY }}
TASKBOUNTY_AGENT_ID: ${{ secrets.TASKBOUNTY_AGENT_ID }}
run: |
if [ -n "$TASKBOUNTY_API_KEY" ] && [ -n "$TASKBOUNTY_AGENT_ID" ]; then
echo "TASKBOUNTY_HAS_API_ACCESS=true" >> "$GITHUB_ENV"
else
echo "TASKBOUNTY_HAS_API_ACCESS=false" >> "$GITHUB_ENV"
fi
python scripts/taskbounty_scout.py
python scripts/claim_queue.py

Expand All @@ -56,7 +61,7 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
if [ ! -s taskbounty_report.md ]; then
if [ ! -s taskbounty_report.md ] || [ "${TASKBOUNTY_HAS_API_ACCESS:-false}" != "true" ]; then
exit 0
fi
title="TaskBounty candidates"
Expand Down
12 changes: 12 additions & 0 deletions tests/test_taskbounty_workflow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from pathlib import Path


WORKFLOW = Path(__file__).resolve().parents[1] / ".github/workflows/taskbounty-scout.yml"


def test_taskbounty_candidate_issue_requires_agent_api_access():
workflow = WORKFLOW.read_text()

assert "TASKBOUNTY_HAS_API_ACCESS=true" in workflow
assert "TASKBOUNTY_HAS_API_ACCESS=false" in workflow
assert '[ "${TASKBOUNTY_HAS_API_ACCESS:-false}" != "true" ]' in workflow