Skip to content

Commit

Permalink
fix: cache
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasbrugneaux committed Oct 17, 2024
1 parent 9e3c0cd commit d7dbec4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/cron-third-party.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- uses: actions/download-artifact@v4
name: Download last version tested
with:
name: last-version-${{ matrix.lib }}
name: /tmp/cache-last-version-${{ matrix.lib }}
path: /tmp/
continue-on-error: true

Expand Down Expand Up @@ -58,7 +58,8 @@ jobs:
- id: compare-version
name: Compare last version with NPM's version
run: |
LAST_VERSION=$(cat /tmp/last-version-${{ matrix.lib }} 2>/dev/null || echo '0.0.0')
FILE_PATH=/tmp/cache-last-version-${{ matrix.lib }}
LAST_VERSION=$(cat $FILEPATH 2>/dev/null || echo '0.0.0')
FETCHED_VERSION="${{ steps.npm-version.outputs.result }}"
echo "Validating last version: $LAST_VERSION ..."
Expand All @@ -67,7 +68,8 @@ jobs:
echo "Validating fetched version: $FETCHED_VERSION ..."
semver validate $FETCHED_VERSION
echo "result=$(semver compare $LAST_VERSION $FETCHED_VERSION)" >> "$GITHUB_OUTPUT"
semver compare $LAST_VERSION $FETCHED_VERSION >> $FILE_PATH
echo "result=$(cat $FILE_PATH)" >> "$GITHUB_OUTPUT"
- run: ls -lA .

Expand All @@ -89,5 +91,5 @@ jobs:
name: Upload version
if: ${{ steps.compare-version.outputs.result }} == -1
with:
name: last-version-${{ matrix.lib }}
path: /tmp/fetched-version-${{ matrix.lib }}
name: cache-last-version-${{ matrix.lib }}
path: /tmp/

0 comments on commit d7dbec4

Please sign in to comment.