Sigh give up and use node-fetch
This commit is contained in:
parent
3e5b1a7442
commit
efda0e7412
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@ -30,19 +30,21 @@ jobs:
|
|||||||
asset_name: TEST.md
|
asset_name: TEST.md
|
||||||
tag: ci-test-${{ matrix.os }}
|
tag: ci-test-${{ matrix.os }}
|
||||||
overwrite: true
|
overwrite: true
|
||||||
|
- run: npm install node-fetch
|
||||||
- name: Check that the uploaded asset is readable
|
- name: Check that the uploaded asset is readable
|
||||||
uses: actions/github-script@v2
|
uses: actions/github-script@v2
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
script: |
|
script: |
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
|
const fetch = require('node-fetch');
|
||||||
|
|
||||||
const expected = fs.readFileSync("README.md")
|
const expected = fs.readFileSync("README.md")
|
||||||
const release = await github.repos.getReleaseByTag({
|
const release = await github.repos.getReleaseByTag({
|
||||||
...context.repo,
|
...context.repo,
|
||||||
tag: "ci-test-${{ matrix.os }}",
|
tag: "ci-test-${{ matrix.os }}",
|
||||||
})
|
})
|
||||||
github.auth = undefined;
|
const actual = await fetch(release.data.assets[0].browser_download_url).text()
|
||||||
const actual = await github.request(release.data.assets[0].browser_download_url)
|
|
||||||
const assert = require('assert').strict;
|
const assert = require('assert').strict;
|
||||||
assert.equal(expected, actual)
|
assert.equal(expected, actual)
|
||||||
- name: Clean up
|
- name: Clean up
|
||||||
|
Loading…
Reference in New Issue
Block a user