From a5d041dc89e44f4d9f6a41238bc52ea3acda7c4b Mon Sep 17 00:00:00 2001 From: Anatoly Leskovets Date: Thu, 28 Sep 2023 18:17:06 -0400 Subject: [PATCH] [532] feat: Conditionally save fit files into GH action output (#532) * feat: conditionally save output files * output dir via env * fit folder --- .github/workflows/sync_peloton_to_garmin.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync_peloton_to_garmin.yml b/.github/workflows/sync_peloton_to_garmin.yml index c3c70ee09..295bb48ed 100644 --- a/.github/workflows/sync_peloton_to_garmin.yml +++ b/.github/workflows/sync_peloton_to_garmin.yml @@ -9,6 +9,9 @@ on: workoutsToDownload: type: number default: "5" + saveLocalCopy: + type: boolean + default: false schedule: - cron: '0 1 * * *' @@ -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 }} @@ -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" @@ -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