From 35c85e287492e646740ff9f455d68ab4410c2420 Mon Sep 17 00:00:00 2001 From: Anatoly Leskovets Date: Sat, 30 Sep 2023 11:54:29 -0400 Subject: [PATCH 1/5] fix(gh-action): Explicitly define default value for saveLocalCopy fixes #534 --- .github/workflows/sync_peloton_to_garmin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync_peloton_to_garmin.yml b/.github/workflows/sync_peloton_to_garmin.yml index 295bb48ed..8ff12c279 100644 --- a/.github/workflows/sync_peloton_to_garmin.yml +++ b/.github/workflows/sync_peloton_to_garmin.yml @@ -48,7 +48,7 @@ jobs: "Fit": true, "Json": false, "Tcx": false, - "SaveLocalCopy": ${{ github.event.inputs.saveLocalCopy }}, + "SaveLocalCopy": ${{ github.event.inputs.saveLocalCopy || false }}, "IncludeTimeInHRZones": false, "IncludeTimeInPowerZones": false, "DeviceInfoPath": "./deviceInfo.xml" From 653d955d29a155a23077cc9fc82c63a62599d238 Mon Sep 17 00:00:00 2001 From: Anatoly Leskovets Date: Sat, 30 Sep 2023 12:12:02 -0400 Subject: [PATCH 2/5] fix: zip folder before uploading --- .github/workflows/sync_peloton_to_garmin.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sync_peloton_to_garmin.yml b/.github/workflows/sync_peloton_to_garmin.yml index 8ff12c279..1f99374f2 100644 --- a/.github/workflows/sync_peloton_to_garmin.yml +++ b/.github/workflows/sync_peloton_to_garmin.yml @@ -88,8 +88,13 @@ jobs: P2G_GARMIN__EMAIL: ${{ secrets.P2G_GARMIN__EMAIL }} P2G_GARMIN__PASSWORD: ${{ secrets.P2G_GARMIN__PASSWORD }} TZ: America/Chicago + + - name: zip output files + if: ${{ github.event.inputs.saveLocalCopy }} + run: | + zip -r output.zip ${{ env.OUTPUT_DIR }} - uses: actions/upload-artifact@v3 if: ${{ github.event.inputs.saveLocalCopy }} with: name: output - path: ${{ env.OUTPUT_DIR }}/fit/*.fit + path: output.zip From 4df86fa488e2c3ae82e4a859c049039c3842697c Mon Sep 17 00:00:00 2001 From: Anatoly Leskovets Date: Sat, 30 Sep 2023 12:19:23 -0400 Subject: [PATCH 3/5] fail if no files --- .github/workflows/sync_peloton_to_garmin.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync_peloton_to_garmin.yml b/.github/workflows/sync_peloton_to_garmin.yml index 1f99374f2..f5b10a1e2 100644 --- a/.github/workflows/sync_peloton_to_garmin.yml +++ b/.github/workflows/sync_peloton_to_garmin.yml @@ -91,10 +91,10 @@ jobs: - name: zip output files if: ${{ github.event.inputs.saveLocalCopy }} - run: | - zip -r output.zip ${{ env.OUTPUT_DIR }} + run: zip -r output.zip ${{ env.OUTPUT_DIR }} - uses: actions/upload-artifact@v3 if: ${{ github.event.inputs.saveLocalCopy }} with: name: output path: output.zip + if-no-files-found: error From 297250cfb7a86f5303c8e42f02c3aace166aa481 Mon Sep 17 00:00:00 2001 From: Anatoly Leskovets Date: Sat, 30 Sep 2023 12:29:43 -0400 Subject: [PATCH 4/5] use papeloto/action-zip --- .github/workflows/sync_peloton_to_garmin.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync_peloton_to_garmin.yml b/.github/workflows/sync_peloton_to_garmin.yml index f5b10a1e2..0a8ed7acb 100644 --- a/.github/workflows/sync_peloton_to_garmin.yml +++ b/.github/workflows/sync_peloton_to_garmin.yml @@ -89,9 +89,12 @@ jobs: P2G_GARMIN__PASSWORD: ${{ secrets.P2G_GARMIN__PASSWORD }} TZ: America/Chicago - - name: zip output files + - name: zip output files if: ${{ github.event.inputs.saveLocalCopy }} - run: zip -r output.zip ${{ env.OUTPUT_DIR }} + uses: papeloto/action-zip@v1 + with: + files: ${{ env.OUTPUT_DIR }} + dest: output.zip - uses: actions/upload-artifact@v3 if: ${{ github.event.inputs.saveLocalCopy }} with: From 5a1b0ac70d15c2dfda5441048f5738e30a9519ce Mon Sep 17 00:00:00 2001 From: Anatoly Leskovets Date: Sat, 30 Sep 2023 13:02:11 -0400 Subject: [PATCH 5/5] revert pre-zip changes back --- .github/workflows/sync_peloton_to_garmin.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/sync_peloton_to_garmin.yml b/.github/workflows/sync_peloton_to_garmin.yml index 0a8ed7acb..8ff12c279 100644 --- a/.github/workflows/sync_peloton_to_garmin.yml +++ b/.github/workflows/sync_peloton_to_garmin.yml @@ -88,16 +88,8 @@ jobs: P2G_GARMIN__EMAIL: ${{ secrets.P2G_GARMIN__EMAIL }} P2G_GARMIN__PASSWORD: ${{ secrets.P2G_GARMIN__PASSWORD }} TZ: America/Chicago - - - name: zip output files - if: ${{ github.event.inputs.saveLocalCopy }} - uses: papeloto/action-zip@v1 - with: - files: ${{ env.OUTPUT_DIR }} - dest: output.zip - uses: actions/upload-artifact@v3 if: ${{ github.event.inputs.saveLocalCopy }} with: name: output - path: output.zip - if-no-files-found: error + path: ${{ env.OUTPUT_DIR }}/fit/*.fit