Bot riêng cho kho: GitHub App txa-repoYour own repository bot: the txa-repo GitHub App
Trang này đọc trực tiếp từ thư mục docs của kho nên luôn khớp với bản trên GitHub.This page is read straight from the repository's docs folder, so it always matches what is on GitHub. Sửa trên GitHubEdit on GitHub
Mặc định bot comment bằng github-actions[bot]. Tạo một GitHub App thì comment, nhãn và status
hiện dưới tên riêng (txa-repo[bot]) với logo riêng.
Không bắt buộc: chưa cài App thì workflow tự dùng token mặc định, mọi thứ vẫn chạy.
1. Tạo App
Mở https://github.com/settings/apps/new (đang đăng nhập bằng tài khoản
TXAVL).Điền:
- GitHub App name:
txa-repo(tên toàn cầu, nếu bị trùng thì dùngtxa-repo-bot). - Homepage URL:
https://github.com/TXAVL/txa-repo - Webhook: bỏ chọn Active (App này không cần nhận webhook).
- GitHub App name:
Repository permissions (để mọi thứ khác là No access):
Quyền Mức Dùng để Actions Read and write chạy lại kiểm tra sau khi chấp nhận agreement Checks Read and write 16 check đánh số trong khung merge Commit statuses Read and write txa/verified,txa/agreementContents Read and write bật tự gộp (auto-merge) Issues Read and write comment, nhãn, xoá comment @txa-repo agreePull requests Read and write đọc PR, tự gộp Metadata Read-only (tự có) Where can this GitHub App be installed? → Only on this account. Bấm Create GitHub App.
Trang App mới mở: ghi lại App ID; kéo xuống Private keys → Generate a private key (tải về file
.pem). Ở mục Display information tải logo lên.
2. Cài App vào kho
Trang App → Install App → TXAVL → Only select repositories → chọn txa-repo → Install.
3. Đưa khoá vào secret (không để lộ khoá)
.\scripts\setup-app.ps1 -AppId 1234567 -KeyFile C:\Users\admin\Downloads\txa-repo.2026-10-27.private-key.pem
Script chỉ chạy gh secret set TXA_APP_ID và gh secret set TXA_APP_PRIVATE_KEY (đọc khoá từ file, không in ra
màn hình). Xong hãy xoá file .pem khỏi máy.
4. Kiểm tra
Mở một PR mới: comment của bot phải hiện tên txa-repo kèm nhãn bot. Nếu vẫn hiện github-actions,
kiểm tra hai secret đã có chưa (gh secret list) và App đã được cài vào txa-repo.
Bonus: vì App gộp PR bằng quyền của nó, lần gộp đó tính như một push thật và tự kích hoạt TXA Publish API.
5. Kho mới, nhớ người đã đồng ý ở kho khác
Kho chạy bot TXA mà bạn dựng (fork) có thể nhớ người đã đồng ý Thỏa thuận Người đóng góp ở kho khác, giống cách winget-pkgs làm với CLA. Trong kho đó, tạo biến repository TXA_AGREEMENT_REPOS (Settings → Secrets and variables → Actions → Variables) với danh sách kho tin cậy, cách nhau bằng dấu phẩy, ví dụ TXAVL/txa-repo. Để trống thì bot chỉ tin TXAVL/txa-repo (và chính kho đó).
Ai đã có PR được gộp, có comment đồng ý đúng phiên bản thỏa thuận hiện hành ở một kho trong danh sách, sẽ không bị hỏi lại; PR của họ vào thẳng bước tick checklist. Muốn bắt mọi người comment lại thì đặt RECOGNISE_RETURNING = False trong tools/src/txa/ci/agreement.py.
By default the bot comments as github-actions[bot]. Create a GitHub App and the comments, labels and
statuses appear under their own name (txa-repo[bot]) with their own logo.
It is optional: until the App is installed the workflow uses the default token and everything keeps working.
1. Create the App
Open https://github.com/settings/apps/new (signed in as the
TXAVLaccount).Fill in:
- GitHub App name:
txa-repo(names are global; if it is taken usetxa-repo-bot). - Homepage URL:
https://github.com/TXAVL/txa-repo - Webhook: untick Active (this App does not need to receive webhooks).
- GitHub App name:
Repository permissions (leave everything else as No access):
Permission Level Used for Actions Read and write re-running the checks after the agreement is accepted Checks Read and write the 16 numbered checks in the merge box Commit statuses Read and write txa/verified,txa/agreementContents Read and write turning on auto-merge Issues Read and write comments, labels, deleting the @txa-repo agreecommentPull requests Read and write reading PRs, merging them Metadata Read-only (granted automatically) Where can this GitHub App be installed? → Only on this account. Press Create GitHub App.
On the new App page note the App ID; scroll to Private keys → Generate a private key (a
.pemfile is downloaded). Under Display information upload the logo.
2. Install the App on the repository
App page → Install App → TXAVL → Only select repositories → choose txa-repo → Install.
3. Put the key into secrets (without exposing it)
.\scripts\setup-app.ps1 -AppId 1234567 -KeyFile C:\Users\admin\Downloads\txa-repo.2026-10-27.private-key.pem
The script only runs gh secret set TXA_APP_ID and gh secret set TXA_APP_PRIVATE_KEY (it reads the key from the
file and never prints it). Delete the .pem file from your PC afterwards.
4. Check it
Open a new PR: the bot's comment must show the name txa-repo with a bot label. If it still shows github-actions,
check that both secrets exist (gh secret list) and that the App is installed on txa-repo.
Bonus: because the App merges PRs with its own permissions, that merge counts as a real push and triggers
TXA Publish API by itself.
5. A new repository remembers people who agreed in another one
A repository you build (a fork) that runs the TXA bot can remember people who already accepted the Contributor Agreement elsewhere, the way winget-pkgs does with its CLA. In that repository create the repository variable TXA_AGREEMENT_REPOS (Settings → Secrets and variables → Actions → Variables) holding the trusted repositories, comma separated, for example TXAVL/txa-repo. Left empty the bot trusts only TXAVL/txa-repo (and the repository itself).
Anyone with a merged PR and an accepted-agreement comment of the current agreement version in a listed repository is not asked again; their PR goes straight to ticking the checklist. To make everyone comment again, set RECOGNISE_RETURNING = False in tools/src/txa/ci/agreement.py.