diff --git a/fixtures/action.yml/not-node/action.yml b/fixtures/action.yml/not-node/action.yml new file mode 100644 index 00000000..8f3c557c --- /dev/null +++ b/fixtures/action.yml/not-node/action.yml @@ -0,0 +1,19 @@ +name: Elixir Script +author: Jon Lauridsen +description: Run simple Elixir scripts +branding: + color: orange + icon: code +inputs: + script: + description: The script to run + required: true + debug: + description: Whether to tell the GitHub client to log details of its requests. true or false. Default is to run in debug mode when the GitHub Actions step debug logging is turned on. + default: ${{ runner.debug == '1' }} +outputs: + result: + description: The stringified return value of the script +runs: + using: docker + image: Dockerfile diff --git a/src/utils/devenv.test.ts b/src/utils/devenv.test.ts index 0746d935..dd235619 100644 --- a/src/utils/devenv.test.ts +++ b/src/utils/devenv.test.ts @@ -98,6 +98,9 @@ Deno.test("devenv.ts", async runner => { await runner.step("empty action.yml has no deps", async () => { const { pkgs } = await specimen(fixturesd.join("action.yml/empty")) assertEquals(pkgs.length, 0) + + const { pkgs: pkgs2 } = await specimen(fixturesd.join("action.yml/not-node")) + assertEquals(pkgs2.length, 0) }) await runner.step("no dir error", async () => { diff --git a/src/utils/devenv.ts b/src/utils/devenv.ts index d6a37f1e..8765a2a9 100644 --- a/src/utils/devenv.ts +++ b/src/utils/devenv.ts @@ -155,11 +155,11 @@ export default async function(dir: Path) { async function github_actions(path: Path) { const yaml = await path.readYAML() if (!isPlainObject(yaml)) return - const [,v] = yaml.runs?.using.match(/node(\d+)/) - if (v) { + const rv = yaml.runs?.using?.match(/node(\d+)/) + if (rv?.[1]) { pkgs.push({ project: "nodejs.org", - constraint: new semver.Range(`^${v}`) + constraint: new semver.Range(`^${rv?.[1]}`) }) } await parse_well_formatted_node(yaml.tea)