Skip to content

Commit

Permalink
Fix action
Browse files Browse the repository at this point in the history
  • Loading branch information
mrruby committed Feb 29, 2024
1 parent 1cb2a67 commit ad4889c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ jobs:
with:
script: |
const fs = require('fs/promises');
fs.readFile('./static/manifest.json', 'utf8')
.then(data => {
const fetchVersionInfo = async () => {
try {
const data = await fs.readFile('./static/manifest.json', 'utf8');
const manifest = JSON.parse(data);
const currentVersion = manifest.version;
return fetch(`https://chromewebstore.google.com/detail/holo-key-manager/${{ secrets.CHROME_ID }}`)
})
.then(response => response.text())
.then(text => {
const response = await fetch(`https://chromewebstore.google.com/detail/holo-key-manager/${process.env.CHROME_ID}`);
const text = await response.text();
const versionPattern = /<div[^>]*>Version<\/div><div[^>]*>(\d+\.\d+\.\d+)<\/div>/;
const versionMatch = text.match(versionPattern);
const latestVersion = versionMatch ? versionMatch[1] : null;
core.setOutput('abort', currentVersion === latestVersion ? 'true' : 'false');
})
.catch(error => {
} catch (error) {
core.setFailed(error.message);
});
}
};
fetchVersionInfo();
- name: Abort build if version matches
if: steps.check_version.outputs.abort == 'true'
run: |
Expand Down

0 comments on commit ad4889c

Please sign in to comment.