Tooling to keep our git mirrors up-to-date.
Run just all in the project root to update all mirrors.
This automation assumes:
- All source repositories are public and they can be accesses without credentials.
- The credentials in the environment variable
OPENCODE_GITLAB_CREDENTIALSauthorize to write all target repositories.
To get this running from scratch in a Github Codespace:
- Start a fresh Codespace on
mainbranch of this repository. - Create a personal access token in OpenCode's Gitlab, choose
read_repositoryandwrite_repositorypermissions. - Create a
.envfile in the root of this repository, with one line:OPENCODE_GITLAB_CREDENTIALS=<USER>:<TOKEN>.
For example, my .env file looks like this (key rotated):
OPENCODE_GITLAB_CREDENTIALS=OC000040163666:glpat-pbJkijPQH-5DguPkydsqOm86MQp1OjN1MQk.01.0z17ynf68I've set up a Github Action workflow to run this automation regularly. The workflow assumes that OPENCODE_GITLAB_CREDENTIALS is configured as Github Actions repository secret. In addition to the daily schedule, the workflow can be dispatched from the Github UI.