When my backups with roam-to-git started failing every hour in January 2021, I rushed to create roam2github. At the time, I didn't fully understand that actions in private repos have a limited number of minutes per month to run on GitHub's free plan, while actions in public repos are unlimited. At the rate my private backups were taking, I would run out of minutes before the month of February was over. So I made some changes to take advantage of the unlimited usage.
<aside> 💡 If you haven't set up roam2github before, go here: Roam2Github Backup Guide
</aside>
Delete main.yml
This will stop the Actions running on your private repo and using up minutes. We'll still use this repo to save the backups.
Add a Personalized Access Token
Go to https://github.com/settings/tokens
Also accessed by going to your account "Settings" (from the dropdown after clicking your profile image in the upper-right), then "Developer settings" in the sidebar, then "Personal access tokens"
Click the "Generate new token" button
(Re-enter GitHub password if asked)
Under "Note", give it a descriptive name, like "Roam backup"
Under "Select scopes", click the checkbox for "repo" (this will also check the 5 boxes indented below it)
Scroll to the bottom and click the green "Generate token" button
You should now see a random string of characters and numbers in a light green background. Click the clipboard icon to copy it. You may want to leave this tab open, just in case you accidentally copy something else. (Because once closed, you'll never see this token again, and have to create a new one.)
Create a new, public repository and include README (You can name it something like "roam2github-actions")
This is where the actions will run and save to your private backup repo. (I've cleaned up the logging, so no personal information will show, like Roam page names).
If you want it to remain private, that's fine, just be aware of the 2000-minute monthly limit on the free plan. (Usage can be monitored under Billing)
Add Secrets
Go to "Settings" (for the repo, not your account), then "Secrets"
Add "New repository secret" named ACCESS_TOKEN
and under Value paste the random token you copied from Step #2
Add "New repository secret" named BACKUP_REPO
The value for this will be your GitHub username, a slash, and the name of your private, backup repo (without <>
symbols): <username>/<repo>
For example, mine is: everruler12/roam-backup
Add the following Secrets with appropriate values.
ROAM_EMAIL
ROAM_PASSWORD
ROAM_GRAPH
These names are more precise descriptions. (You're not logging into some "R2G" app.)
You can delete the old Secrets in your backup repo starting with R2G_...
, as those are no longer used.
Add Actions
https://eriknewhard.ck.page/b1cd7d35fa
This will only be used to notify you of updates to Roam2Github, and won't be used for my personal newsletter or anything else.