Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Mqxx committed Feb 6, 2024
1 parent ad999a8 commit 283fdfe
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
import * as actionsCore from '@actions/core';
import * as actionsArtifact from '@actions/artifact';

const artifact = new actionsArtifact.DefaultArtifactClient();
const artifactClient = new actionsArtifact.DefaultArtifactClient();

// import { fetchManifestData } from './fetch_manifest_data.ts';
import { fetchManifestData } from './fetch_manifest_data.ts';

// const inputManifestURL = actionsCore.getInput('manifest-url');
const inputManifestURL = actionsCore.getInput('manifest-url');

(async () => {
// console.log((await fetchManifestData(inputManifestURL)).latest);
const latestManifest = (await fetchManifestData(inputManifestURL)).latest
Deno.writeTextFileSync(
'./data/latest_manifest.json',
JSON.stringify(latestManifest)
)
artifactClient.uploadArtifact(
'latest_manifest.json',
['./data/latest_manifest.json'],
'./data/latest_manifest.json'
)

const artifacts = await artifact.listArtifacts({latest: true})
artifacts.artifacts.forEach(({createdAt, id, name, size}) => {
console.log(createdAt, id, name, size);
})
// const artifacts = await artifactClient.listArtifacts({latest: true})
// artifacts.artifacts.forEach(({createdAt, id, name, size}) => {
// console.log(createdAt, id, name, size);
// })
})()

0 comments on commit 283fdfe

Please sign in to comment.