updateRepo function
Implementation
Future<void> updateRepo(GitlabClient gl, String projectId, String studyId) async {
// Update sessionToken project var
print('Updating project session variable...');
gl.updateProjectVariable(
projectId: projectId,
key: 'session',
value: env.client.auth.session()!.persistSessionString,
);
print('Fetching study schema and subjects');
final study = await fetchStudySchema(studyId);
final subjects = await fetchSubjects(studyId);
print('Committing to Gitlab...');
await gl.makeCommit(
projectId: projectId,
message: 'Updating data and triggering CI notebook html refresh',
actions: [
gl.commitAction(filePath: 'data/study.schema.json', content: prettyJson(study.toJson()), action: 'update'),
gl.commitAction(filePath: 'data/subjects.csv', content: subjects, action: 'update'),
],
);
// Make git commit
}