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 9ac1907 commit c63a154
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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

Expand Down

0 comments on commit c63a154

Please sign in to comment.