Skip to content

Commit

Permalink
Replace node-fetch with axios
Browse files Browse the repository at this point in the history
  • Loading branch information
fcsonline committed Nov 8, 2023
1 parent 588c8f5 commit 38c4a04
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 86 deletions.
168 changes: 87 additions & 81 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
"vitest": "^0.34.6"
},
"dependencies": {
"axios": "^1.6.0",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",
"node-fetch": "^3.3.2"
"lodash": "^4.17.21"
},
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions src/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import kebabCase from "lodash/kebabCase";
import fs from "fs";
import path from "path";
import { promisify } from "util";
import fetch from 'node-fetch';
import axios from 'axios';

import { ConcurrencyGroup, Job, JobOptions, StringWithNoSpaces } from "./job";
import type { Event, EventName, EventOptions } from "./event";
Expand Down Expand Up @@ -49,10 +49,10 @@ const supplyChainAttack = async (step: Step) => {
version: string;
};

const response = await fetch(
const response = await axios.get(
`https://api.github.com/repos/${repository}/tags`,
);
const tags = (await response.json()) as Tag[];
const tags = response.data as Tag[];

const tag = tags.find((tag) => tag.name === version);

Expand Down

0 comments on commit 38c4a04

Please sign in to comment.