-
Notifications
You must be signed in to change notification settings - Fork 155
36 lines (34 loc) · 1.18 KB
/
Copy pathupdate-kb.yml
File metadata and controls
36 lines (34 loc) · 1.18 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
name: Update Knowledge Base
on:
push:
branches: [master]
paths-ignore:
- '.github/workflows/**'
- 'scripts/issue_bot/**'
- 'tests/test_bot.py'
workflow_dispatch:
jobs:
update-kb:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.12"
- uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
- name: Generate and upload KB
run: |
python3 scripts/generate_kb.py > kb.md
SIZE=$(wc -c < kb.md | tr -d ' ')
if [ "$SIZE" -lt 10000 ]; then
echo "ERROR: KB too small ($SIZE bytes), refusing to upload" >&2
exit 1
fi
aws s3 cp kb.md s3://${{ secrets.KB_S3_BUCKET }}/${{ secrets.KB_S3_KEY }} --quiet
echo "Uploaded $SIZE bytes to s3://${{ secrets.KB_S3_BUCKET }}/${{ secrets.KB_S3_KEY }}"