include auth header in API call
All checks were successful
Distribution check / Generated files check (push) Successful in -2m1s
NPM Audit Check / Check NPM audit (push) Successful in -2m10s
Unit tests / Unit tests (latest) (push) Successful in -2m1s
Unit tests / Unit tests (lts/*) (push) Successful in -2m0s
Unit tests / Unit tests (lts/hydrogen) (push) Successful in -2m1s
All checks were successful
Distribution check / Generated files check (push) Successful in -2m1s
NPM Audit Check / Check NPM audit (push) Successful in -2m10s
Unit tests / Unit tests (latest) (push) Successful in -2m1s
Unit tests / Unit tests (lts/*) (push) Successful in -2m0s
Unit tests / Unit tests (lts/hydrogen) (push) Successful in -2m1s
This commit is contained in:
@@ -3,7 +3,7 @@ import { context } from '@actions/github';
|
||||
import ky from 'ky';
|
||||
import { parse } from './pkgbase.js';
|
||||
;
|
||||
async function main() {
|
||||
export async function main() {
|
||||
const mode = core.getInput('mode', { required: true }).toLocaleLowerCase();
|
||||
if (mode === 'parse') {
|
||||
await doParse();
|
||||
@@ -18,7 +18,7 @@ async function main() {
|
||||
if (mode === 'move') {
|
||||
for (const pkg of parsedData.move) {
|
||||
const filename = getFilename(pkg);
|
||||
const files = await ky.get(`${context.serverUrl}/api/v1/packages/${context.repo.owner}/arch/${pkg.package}/${pkg.version}/files`).json();
|
||||
const files = await ky.get(`${context.serverUrl}/api/v1/packages/${context.repo.owner}/arch/${pkg.package}/${pkg.version}/files`, { headers }).json();
|
||||
const match = files.filter(f => f.name === filename);
|
||||
if (match.length !== 1) {
|
||||
throw new Error(`Expected one matching package, found ${match.length}`);
|
||||
@@ -50,5 +50,4 @@ async function doParse() {
|
||||
const diff = await parse(previous, current);
|
||||
core.setOutput('parsed-data', JSON.stringify(diff));
|
||||
}
|
||||
export { main };
|
||||
//# sourceMappingURL=router.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -31,7 +31,7 @@ export async function main() {
|
||||
if (mode === 'move') {
|
||||
for (const pkg of parsedData.move) {
|
||||
const filename = getFilename(pkg);
|
||||
const files = await ky.get(`${context.serverUrl}/api/v1/packages/${context.repo.owner}/arch/${pkg.package}/${pkg.version}/files`).json<PackageFile[]>();
|
||||
const files = await ky.get(`${context.serverUrl}/api/v1/packages/${context.repo.owner}/arch/${pkg.package}/${pkg.version}/files`, { headers }).json<PackageFile[]>();
|
||||
const match = files.filter(f => f.name === filename);
|
||||
if (match.length !== 1) {
|
||||
throw new Error(`Expected one matching package, found ${match.length}`);
|
||||
|
||||
Reference in New Issue
Block a user