Files
time/.github/workflows/mention.yml
T
teahubxyzandClaude Fable 5.1 68acc0217e
ci / test (pull_request) Successful in 35s
mention: book the seats' spend to the ledger as the time bot
The mention runner's ledger flush was failing on every reply ("User permission denied for
writing"): main is PR-only for the Actions identity, and this workflow was the only one not
handed TIME_TOKEN, so @seat replies went unbooked and the daily governor undercounted them.
Same env line the heartbeat, venture and astra workflows already carry.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LaVWDr6h62YJk9LJqvQH7k
2026-10-17 17:48:21 +00:00

39 lines
1.6 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 }}
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 }}