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

This commit is contained in:
2025-11-07 00:28:53 -05:00
parent 6d8f1d007d
commit 65097b3b1f
3 changed files with 4 additions and 5 deletions

View File

@@ -3,7 +3,7 @@ import { context } from '@actions/github';
import ky from 'ky'; import ky from 'ky';
import { parse } from './pkgbase.js'; import { parse } from './pkgbase.js';
; ;
async function main() { export async function main() {
const mode = core.getInput('mode', { required: true }).toLocaleLowerCase(); const mode = core.getInput('mode', { required: true }).toLocaleLowerCase();
if (mode === 'parse') { if (mode === 'parse') {
await doParse(); await doParse();
@@ -18,7 +18,7 @@ async function main() {
if (mode === 'move') { if (mode === 'move') {
for (const pkg of parsedData.move) { for (const pkg of parsedData.move) {
const filename = getFilename(pkg); 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); const match = files.filter(f => f.name === filename);
if (match.length !== 1) { if (match.length !== 1) {
throw new Error(`Expected one matching package, found ${match.length}`); throw new Error(`Expected one matching package, found ${match.length}`);
@@ -50,5 +50,4 @@ async function doParse() {
const diff = await parse(previous, current); const diff = await parse(previous, current);
core.setOutput('parsed-data', JSON.stringify(diff)); core.setOutput('parsed-data', JSON.stringify(diff));
} }
export { main };
//# sourceMappingURL=router.js.map //# sourceMappingURL=router.js.map

File diff suppressed because one or more lines are too long

View File

@@ -31,7 +31,7 @@ export async function main() {
if (mode === 'move') { if (mode === 'move') {
for (const pkg of parsedData.move) { for (const pkg of parsedData.move) {
const filename = getFilename(pkg); 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); const match = files.filter(f => f.name === filename);
if (match.length !== 1) { if (match.length !== 1) {
throw new Error(`Expected one matching package, found ${match.length}`); throw new Error(`Expected one matching package, found ${match.length}`);