Use a workspace bot for collection sync, so not everyone needs repository access
Collection sync normally works like Git does: everyone connects their own GitHub, GitLab or Bitbucket account and commits in their own name. That's the right default, until the QA engineer who edits the collection every day doesn't have write access to the backend repository, or a pipeline needs to push and has no account at all.
A workspace bot is the other mode: one shared provider account that a linked collection syncs through.
What changes when a link uses a bot
- People who can edit the collection pull and push without connecting anything.
- Commits are made by the bot account, and the person who pushed is named in the commit:
```text Update Billing API from Requestarium (2 changed)
Co-authored-by: Ann Lee <[email protected]> ```
GitHub, GitLab and Bitbucket show both the bot and the member. The email is the member's Requestarium account email, so everyone who can read the repository sees it.
- Branch protection and permissions are the bot's, not the member's.
- The link still only writes inside its own folder.
The bot is chosen per link, so other collections keep syncing with personal accounts.
Setting it up
Workspace admins open the collection's Overview ▸ Sync with Git and, in the linked view, Use a workspace bot…:
- Add bot account: paste a token. It's checked with the provider, stored encrypted and never shown again.
- Use for this collection: Requestarium checks that the bot is on the same provider and server as the link, can see the repository and branch, and may push.
Back to personal accounts switches the link back. Members who aren't admins can see which bot a link uses, but can't add or choose one.
Which token to use:
| Provider | Token |
|---|---|
| GitHub | the Requestarium GitHub App (below), or a fine-grained token of a dedicated machine user with Contents: read and write |
| GitLab | a project or group access token, role Developer (Maintainer for protected branches), scope api |
| Bitbucket Cloud | an Atlassian API token with scopes of a dedicated bot account, plus its email |
Tokens aren't refreshed. When one expires, add a new bot account, switch the links to it, and remove the old one.
The GitHub App as the bot
On GitHub, when the server has the Requestarium GitHub App set up, an admin can pick an installation of the Requestarium GitHub App instead of a token. The server exchanges the app's key for a one-hour installation token, keeps it in memory and renews it, so there's no machine user and nothing to rotate.
Commits are made by requestarium[bot], and the member is named without an email, so it isn't published to the repository:
Update Billing API from Requestarium (2 changed)
Pushed-by: Ann Lee (Requestarium)The bot can only reach the repositories selected when the app was installed. The dialog lists the installations the admin's own GitHub connection can see, which is how Requestarium knows the admin may use them. This option isn't available for GitHub Enterprise Server; use a token bot there.
Bots and CI tokens
A pipeline that runs requestarium sync push or sync pull should sign in with a CI token from Settings ▸ Sync ▸ CI tokens (Team and Enterprise):
- Check only (
sync:read) is enough forsync push --checkandsync status --check. Push and pull (sync:write) addssync pushandsync pull. - It belongs to the organization, covers every workspace or one, and always expires: 30 days, 90 days or a year.
- It can't change links, bots or schedules, or create tokens.
A CI token has no Git account of its own, so a Git-linked collection can only be synced by a CI token when the link uses a bot. Without one, the CLI reports that the account isn't connected. Bucket links need nothing extra. Commits made by a pipeline through a bot carry the token's name in the trailer, so the history shows which pipeline pushed.