How to create collection repositories
Collections in Open Terms Archive rely on three Git repositories to hold the data, and optionally a fourth one to publish tracking results:
- Declarations repository: stores the declarations that define terms to track
- Snapshots repository: stores raw snapshots of tracked terms
- Versions repository: stores processed versions of tracked terms
- Tracking results repository (optional): stores the tracking status of each terms and the lifecycle of each tracking run
This guide assumes you use GitHub. For other Git platforms, adapt these steps accordingly.
Before starting, ensure you have:
- A GitHub account with permissions to create repositories
- Your collection ID and name defined
- Your collection metadata prepared
- Go to the
demo-declarations repository - Click the “Use this template” drop-down menu and select “Create a new repository”
- Name it
<collection_id>-declarations (e.g. pga-declarations) - Wait 1-2 minutes for automatic setup to complete (check
first-time-setup action status)
Set up the “About” section:
- Click the cogwheel icon next to “About”
- Add description: “Declarations for
<collection_name>. Maintained by <maintainer>.” - Set website:
https://opentermsarchive.org - Add tags:
terms-of-service, terms-of-service-agreements, terms-and-conditions, open-terms-archive - Uncheck “Releases”, “Packages” and “Deployments”
Configure features:
- In “General → Features”:
- Disable “Wikis” and “Projects”
- In “General → Pull Requests”:
- Enable only “Allow squash merging” with “Default to pull request title and commit details”
- Enable “Allow auto-merge”
- Enable “Automatically delete head branches”
- In “Branches”:
- Add branch protection for
main - Require pull request with 1 approval
- Require status checks:
validate_modified_declarations and validate_schema
- In “Actions”:
- Allow all actions and reusable workflows
Remove all default labels
Update content:
- Update README with collection metadata
- Update
metadata.yml with collection metadata
- Go to
demo-snapshots - Click “Use this template” and select “Create a new repository”
- Name it
<collection_id>-snapshots - Wait for automatic setup to complete
Set up “About” section:
- Add description: “Terms snapshots for
<collection_name>. Maintained by <maintainer>.” - Set website:
https://opentermsarchive.org - Add standard tags
- Uncheck “Releases”, “Packages” and “Deployments”
Configure features:
- Disable Wikis, Issues, Discussions, and Projects
- Disable GitHub Actions
- Go to
demo-versions - Click “Use this template” and select “Create a new repository”
- Name it
<collection_id>-versions - Wait for automatic setup to complete
Set up “About” section:
- Add description: “Terms versions for
<collection_name>. Maintained by <maintainer>.” - Set website to terms navigation documentation
- Add standard tags
- Uncheck “Packages” and “Deployments”
Configure features:
- Disable Wikis, Issues, Discussions, and Projects
- Disable GitHub Actions
Update README with collection metadata
This repository is optional: without it, the engine records tracking results on the server only, without publishing them.
- Create a new repository named
<collection_id>-tracking-results - Check “Add a README file”, as the deployment can only clone a repository that has at least one commit
Set up “About” section:
- Add description: “Tracking results for
<collection_name>. Maintained by <maintainer>.” - Set website:
https://opentermsarchive.org - Add standard tags
- Uncheck “Releases”, “Packages” and “Deployments”
Configure features:
- Disable Wikis, Issues, Discussions, and Projects
- Disable GitHub Actions
In the config/production.json file of the declarations repository, declare the tracking results repository and enable its publication:
{
"@opentermsarchive/engine": {
"tracking-results": {
"storage": {
"git": {
"repository": "git@github.com:<organization>/<collection_id>-tracking-results.git",
"path": "./data/tracking-results",
"publish": true
}
}
}
}
}
The deployment clones the repository declared in repository on the server, and publish makes the engine push the tracking results at the end of each tracking run, which it does not do by default. See the configuration reference for all options.
For collections within the Open Terms Archive organization:
- Create a new collection team
- Configure team:
- Name it after the collection
- Set collection icon as avatar
- Description: “Maintainers of the
<collection_name> collection”
- Set repository access:
- Declarations repository: “Maintain” access
- Snapshots repository: “Triage” access
- Versions repository: “Triage” access
- Tracking results repository, if any: “Triage” access
- Add team members
- Add repositories to Bots team with “Write” access