Skip to content

Commit

Permalink
remove any type from update-action-versions (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
momentmaker authored Oct 31, 2023
1 parent d7e72b2 commit 9128c92
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions apps/update-action-versions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import { parse, parseDocument } from "yaml";
import * as semver from "semver";
import { replaceInFile } from "replace-in-file";

interface Scalar {
comment?: string;
}

interface ActionMapItem {
version: string;
shasum: string;
Expand Down Expand Up @@ -96,20 +100,17 @@ async function buildWorkflowMap(
for (let i = 0; i < parsed.jobs[job].steps.length; i++) {
if (parsed.jobs[job].steps[i].uses) {
const [name, ref] = parsed.jobs[job].steps[i].uses.split("@");
const usesScalar: any = parsedDoc.getIn(
const usesScalar = parsedDoc.getIn(
["jobs", job, "steps", i, "uses"],
true,
);
) as Scalar;
const actionObj: ActionObj = {
path: `jobs.${job}.steps[${i}]`,
name,
refBefore: ref,
};
if (usesScalar.comment) {
actionObj.commentBefore = (usesScalar.comment as string).replace(
" ",
"",
);
actionObj.commentBefore = usesScalar.comment.replace(" ", "");
}
workflowMap[file].push(actionObj);
}
Expand Down

0 comments on commit 9128c92

Please sign in to comment.