Github Actions
A Github Actions workflow exists that can be used to automatically sync your rides on a schedule (by default once a day).
Warning
This option does not support Garmin accounts protected by Two Step Verification.
Getting started
The easiest way to use the action is to simply create a fork of the repo using the Fork
button.
- Create an account on GitHub
- Navigate to the P2G repo
- In the upper right hand corner, click the button that says
Fork
- Make note of the url to your forked copy
- Continue on to the Secrets instructions below
Secrets
Once you've created your fork, you'll need to set a number of secrets in your repository.
- From your forked copy of P2G, click the
Settings
- Then, on the side nav, select
Secrets
and thenActions
. - Continue on to the Action Permissions instructions below
From this point on you can add secrets by clicking the New repository secret
button at the top right.
Secret Name | Value |
---|---|
P2G_PELOTON__EMAIL |
The email address you use to login to Peloton |
P2G_PELOTON__PASSWORD |
The password that you use to login to Peloton |
P2G_GARMIN__EMAIL |
The email address that you use to login to Garmin |
P2G_GARMIN__PASSWORD |
The password that you use to log into Garmin |
DEVICE_INFO |
The contents of the deviceInfo.xml that you want to use for the sync |
Action Permissions
- From your forked copy of P2G, click the
Settings
tab - Navigate to the settings for
Actions > General
- Under
Action Permissions
choose the 4th radio button titled: "Allow, and select non- , actions and reusable workflows". - Under the same radio button, check the checkbox to "Allow actions created by GitHub"
Starting the workflow
Once you've configured your secrets, you can then navigate to the Actions
tab within your repository.
- Enable actions for your fork.
- You can now run the
Sync workflow
manually
To have tha action run on a schedule set the cron
line in the ./github/workflows/sync_peloton_to_garmin.yml
file.
Configuration
If you're doing more than 5 activities a day, you will need to change the default number of workouts downloaded as part of the workflow. This is configured in the ./github/workflows/sync_peloton_to_garmin.yml
file.
Updating
- Make note of your current configuration in
.github/workflows/sync_peloton_to_garmin.yml
as you may need to reapply these changes after updating. - From the home page of your forked repository, there should be a button to
Sync fork
, click this to pull in the latest changes from the original repo. - Go back to your
.github/workflows/sync_peloton_to_garmin.yml
and re-apply any changes from step 1.