Skip to content

Commit

Permalink
Fix script
Browse files Browse the repository at this point in the history
  • Loading branch information
mrruby committed Jan 30, 2024
1 parent 57f9c93 commit 2d9eaf1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
uses: actions/github-script@v6
with:
script: |
const fs = require('fs');
const nodeFetch = require('node-fetch');
const manifest = JSON.parse(fs.readFileSync('./static/manifest.json', 'utf8'));
import fs from 'fs/promises';
import fetch from 'node-fetch';
const manifest = JSON.parse(await fs.readFile('./static/manifest.json', 'utf8'));
const currentVersion = manifest.version;
const response = await nodeFetch(`https://chrome.google.com/webstore/detail/${{ secrets.CHROME_CLIENT_ID }}?hl=en`);
const response = await fetch(`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;
Expand Down

0 comments on commit 2d9eaf1

Please sign in to comment.