From c63a1543739b58f92b3c3653505360846f29b974 Mon Sep 17 00:00:00 2001 From: Dawid Urbas Date: Tue, 30 Jan 2024 16:52:35 +0000 Subject: [PATCH] Fix script --- .github/workflows/test.yaml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 840c3db..a30f41a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,16 +11,21 @@ jobs: name: test steps: + - uses: actions/checkout@v4 + - name: Setup Node.js environment + uses: actions/setup-node@v3 + with: + node-version: 18 - name: Check version against latest release in Chrome Web Store id: check_version uses: actions/github-script@v6 with: script: | const fs = require('fs'); - const fetch = require('node-fetch'); + const nodeFetch = require('node-fetch'); const manifest = JSON.parse(fs.readFileSync('./static/manifest.json', 'utf8')); const currentVersion = manifest.version; - const response = await fetch(`https://chrome.google.com/webstore/detail/${{ secrets.CHROME_CLIENT_ID }}?hl=en`); + const response = await nodeFetch(`https://chrome.google.com/webstore/detail/${{ secrets.CHROME_CLIENT_ID }}?hl=en`); const text = await response.text(); const match = text.match(/"version": "(\d+\.\d+\.\d+)"/); const latestVersion = match ? match[1] : null; @@ -34,12 +39,6 @@ jobs: run: | echo "Version in manifest matches the latest release version in Chrome Web Store. Aborting build." exit 1 - - uses: actions/checkout@v4 - - name: Setup Node.js environment - uses: actions/setup-node@v3 - with: - node-version: 18 - - name: Install pnpm run: npm install -g pnpm