-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (44 loc) · 1.81 KB
/
Copy pathdrift-watch.yml
File metadata and controls
50 lines (44 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Drift Watch
# Weekly scan for kie.ai drift — removed/paused slugs, pricing changes, new
# models (issue #44). Findings land in a single rolling GitHub issue. Add a
# KIE_API_KEY repo secret to enable per-slug liveness probes (0 credits); the
# pricing + new-model scans run without it.
on:
schedule:
- cron: '0 8 * * 1' # Mondays 08:00 UTC
workflow_dispatch:
permissions:
contents: read
issues: write
jobs:
drift:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Run drift watch
id: scan
env:
KIE_API_KEY: ${{ secrets.KIE_API_KEY }}
run: |
node scripts/drift-watch.mjs | tee out.txt
findings=$(grep -oE 'DRIFT_FINDINGS=[0-9]+' out.txt | tail -1 | cut -d= -f2)
echo "findings=${findings:-0}" >> "$GITHUB_OUTPUT"
- name: Upsert rolling issue
if: steps.scan.outputs.findings != '0'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TITLE='🔭 kie.ai drift watch'
num=$(gh issue list --state open --search "$TITLE in:title" --json number --jq '.[0].number // empty')
if [ -n "$num" ]; then
gh issue edit "$num" --body-file drift-report.md
gh issue comment "$num" --body "🔄 Drift watch re-ran — ${{ steps.scan.outputs.findings }} finding group(s). Body updated. ([run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}))"
echo "Updated issue #$num"
else
gh issue create --title "$TITLE" --body-file drift-report.md --label drift-watch 2>/dev/null \
|| gh issue create --title "$TITLE" --body-file drift-report.md
echo "Created rolling issue"
fi