Skip to content

Commit

Permalink
[532] feat: Conditionally save fit files into GH action output (#532)
Browse files Browse the repository at this point in the history
* feat: conditionally save output files

* output dir via env

* fit folder
  • Loading branch information
anlesk authored Sep 28, 2023
1 parent e49dac2 commit a5d041d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/sync_peloton_to_garmin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
workoutsToDownload:
type: number
default: "5"
saveLocalCopy:
type: boolean
default: false
schedule:
- cron: '0 1 * * *'

Expand All @@ -19,7 +22,9 @@ jobs:
container:
image: philosowaffle/peloton-to-garmin:stable
steps:
- run: mkdir -p /app/output
- name: Set env
run: echo "OUTPUT_DIR=/app/output" >> $GITHUB_ENV
- run: mkdir -p ${{ env.OUTPUT_DIR }}
- name: Create device info file
env:
DEVICE_INFO: ${{ secrets.DEVICE_INFO }}
Expand All @@ -43,7 +48,7 @@ jobs:
"Fit": true,
"Json": false,
"Tcx": false,
"SaveLocalCopy": false,
"SaveLocalCopy": ${{ github.event.inputs.saveLocalCopy }},
"IncludeTimeInHRZones": false,
"IncludeTimeInPowerZones": false,
"DeviceInfoPath": "./deviceInfo.xml"
Expand Down Expand Up @@ -83,3 +88,8 @@ jobs:
P2G_GARMIN__EMAIL: ${{ secrets.P2G_GARMIN__EMAIL }}
P2G_GARMIN__PASSWORD: ${{ secrets.P2G_GARMIN__PASSWORD }}
TZ: America/Chicago
- uses: actions/upload-artifact@v3
if: ${{ github.event.inputs.saveLocalCopy }}
with:
name: output
path: ${{ env.OUTPUT_DIR }}/fit/*.fit

0 comments on commit a5d041d

Please sign in to comment.