Skip to content

Commit 38c4a04

Browse files
committed
Replace node-fetch with axios
1 parent 588c8f5 commit 38c4a04

File tree

3 files changed

+92
-86
lines changed

3 files changed

+92
-86
lines changed

package-lock.json

Lines changed: 87 additions & 81 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
"vitest": "^0.34.6"
3838
},
3939
"dependencies": {
40+
"axios": "^1.6.0",
4041
"js-yaml": "^4.1.0",
41-
"lodash": "^4.17.21",
42-
"node-fetch": "^3.3.2"
42+
"lodash": "^4.17.21"
4343
},
4444
"repository": {
4545
"type": "git",

src/workflow.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import kebabCase from "lodash/kebabCase";
33
import fs from "fs";
44
import path from "path";
55
import { promisify } from "util";
6-
import fetch from 'node-fetch';
6+
import axios from 'axios';
77

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

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

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

0 commit comments

Comments
 (0)