Files
time/.github/workflows/mention.yml
T
teahubxyz d09c82c202
sync / sync (push) Successful in 55s
ci / test (push) Successful in 1m24s
mention: book the seats' spend to the ledger (TIME_TOKEN for the flush) (#70)
mention.yml gets TIME_TOKEN like heartbeat, so the seats' spend flush can push the ledger (reviewed by the steward)
2026-10-29 18:12:22 +00:00

41 lines
1.7 KiB
YAML

name: mention
# @seat [model] [effort] in an issue, PR or comment -> that seat replies in the thread.
on:
issues:
types: [opened]
issue_comment:
types: [created]
permissions:
contents: read
issues: write
pull-requests: write
concurrency:
group: mention-${{ github.event.issue.number }}
cancel-in-progress: false
jobs:
reply:
# cheap filter before a runner spins up: a mention, and not Time's own comment (Gitea fires events for the Actions
# token's writes). Who may spend the seats' credits is checked in time.py (collaborator permission); Gitea has no
# author_association in the event.
if: >-
contains(github.event.comment.body || github.event.issue.body, '@') &&
(github.event.comment.user.login || github.event.issue.user.login) != 'gitea-actions' &&
(github.event.comment.user.login || github.event.issue.user.login) != 'time'
runs-on: ubuntu-latest
timeout-minutes: 8
steps:
- uses: actions/checkout@v5
with:
sparse-checkout: .github/time
- run: python3 .github/time/time.py mention
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VENICE_API_KEY: ${{ secrets.VENICE_API_KEY }}
LANGFUSE_PUBLIC_KEY: ${{ secrets.LANGFUSE_PUBLIC_KEY }}
LANGFUSE_SECRET_KEY: ${{ secrets.LANGFUSE_SECRET_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
TIME_TOKEN: ${{ secrets.TIME_TOKEN }} # repo secret: the ledger flush pushes to main as the `time` bot (the Actions identity may not)
TIME_TRUSTED: ${{ vars.TIME_TRUSTED }} # org owners etc.; collaborators are trusted without being listed
TIME_DAILY_USD: ${{ vars.TIME_DAILY_USD }}
TIME_MONTHLY_USD: ${{ vars.TIME_MONTHLY_USD }}