You can use this code to create all your new projects with a specific template. For instance, you can have a first issue to welcome all collaborators, explain them how your repository works and ask them to answer with a comment. This will make sure all collaborators know how to find issues and how to interact with you.
Given you have a GitLab.com account, this code can also be run to contribute to ‘gitlabr’ and set a testing environment (See CONTRIBUTING.md).
GITLAB_COM_TOKEN
usethis::edit_r_environ()
to open the
correct filetestor.main
, owned by the
userProject is initialized with a README file.
README.md
# Content of the README
content_md <- paste("
# testor.main
Repository to test R package ['gitlabr'](https://github.com/statnmap/gitlabr)
")
# Push file with a commit
gl_push_file(
project = project_info$id,
file_path = "README.md",
content = content_md,
commit_message = "Update README",
branch = main_branch,
overwrite = TRUE
)
The “.gitlab-ci.yml” below is a simple example of CI with artifact.
If you want a proper CI for your R package or bookdown project, you may
want to look at gitlabr::use_gitlab_ci()
and run it once
you cloned your project locally.
# Create an issue
issue_info <- gl_create_issue(
project = project_info$id,
title = "Dont close issue 1",
description = "An example issue to not close for tests"
)
# Create a comment to the issue
gl_comment_issue(
project = project_info$id,
id = issue_info$iid,
text = "A comment on issue to not close"
)
testor.main
, owned by the userREADME.md