mamba-org / setup-micromamba

GitHub Action to set up micromamba
MIT License
105 stars 16 forks source link

Unhelpful error message if invalid version is specified #90

Closed jonashaag closed 1 year ago

jonashaag commented 1 year ago

I did this

micromamba-version: 1.4.7

and got this unhelpful message

/home/runner/work/_actions/mamba-org/setup-micromamba/875557da4ee020f18df03b8910a42203fbf02da1/dist/index.js:62099
    throw result.error;
    ^

ZodError: [
  {
    "validation": "regex",
    "code": "invalid_string",
    "message": "Invalid",
    "path": []
  }
]
    at Object.get error [as error] (/home/runner/work/_actions/mamba-org/setup-micromamba/875557da4ee020f18df03b8910a42203fbf02da1/dist/index.js:62001:23)
    at ZodUnion.parse (/home/runner/work/_actions/mamba-org/setup-micromamba/875557da4ee020f18df03b8910a42203fbf02da1/dist/index.js:62099:18)
    at parseOrUndefined (/home/runner/work/_actions/mamba-org/setup-micromamba/875557da4ee020f18df03b8910a42203fbf02da1/dist/index.js:65130:18)
    at getOptions (/home/runner/work/_actions/mamba-org/setup-micromamba/875557da4ee020f18df03b8910a42203fbf02da1/dist/index.js:65215:24)
    at Object.<anonymous> (/home/runner/work/_actions/mamba-org/setup-micromamba/875557da4ee020f18df03b8910a42203fbf02da1/dist/index.js:65237:15)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
  issues: [
    {
      validation: 'regex',
      code: 'invalid_string',
      message: 'Invalid',
      path: []
    }
  ],
  addIssue: [Function (anonymous)],
  addIssues: [Function (anonymous)]
}
naclomi commented 1 year ago

I was trying to make use of an old GitHub Actions recipe from an unmaintained project and was banging my head against a wall facing this error. I walked away to get some coffee and then as if by magic, this issue was posted by the time I got back! Thanks for the debugging help @jonashaag :)

pavelzw commented 1 year ago

You should get a better error message

image