Skip to content

Commit

Permalink
handle action.yml without node
Browse files Browse the repository at this point in the history
Fixes #732
  • Loading branch information
mxcl committed Sep 16, 2023
1 parent 5f01f54 commit 34bc476
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
19 changes: 19 additions & 0 deletions fixtures/action.yml/not-node/action.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions src/utils/devenv.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
6 changes: 3 additions & 3 deletions src/utils/devenv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 34bc476

Please sign in to comment.