prefix-dev / setup-pixi

GitHub Action to set up pixi :octocat: 📦
https://pixi.sh/dev/advanced/github_actions
BSD 3-Clause "New" or "Revised" License
56 stars 10 forks source link

`pixi-version` errors when given an actual version #15

Closed Hofer-Julian closed 1 year ago

Hofer-Julian commented 1 year ago

When trying a sightly simplified example from the README

      - uses: prefix-dev/setup-pixi@v0.2.0
        with:
          pixi-version: "0.2.0"
          cache: true

I get the following error:

/home/runner/work/_actions/prefix-dev/setup-pixi/v0.2.0/dist/index.js:57957
    throw result.error;
    ^

ZodError: [
  {
    "validation": "regex",
    "code": "invalid_string",
    "message": "Invalid",
    "path": []
  }
]
    at get error [as error] (/home/runner/work/_actions/prefix-dev/setup-pixi/v0.2.0/dist/index.js:57858:24)
    at ZodUnion.parse (/home/runner/work/_actions/prefix-dev/setup-pixi/v0.2.0/dist/index.js:57957:18)
    at parseOrUndefined (/home/runner/work/_actions/prefix-dev/setup-pixi/v0.2.0/dist/index.js:60973:17)
    at getOptions (/home/runner/work/_actions/prefix-dev/setup-pixi/v0.2.0/dist/index.js:61050:18)
    at Object.<anonymous> (/home/runner/work/_actions/prefix-dev/setup-pixi/v0.2.0/dist/index.js:61073:15)
    at Module._compile (node:internal/modules/cjs/loader:1233:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1287:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12) {
  issues: [
    {
      validation: 'regex',
      code: 'invalid_string',
      message: 'Invalid',
      path: []
    }
  ],
  addIssue: [Function (anonymous)],
  addIssues: [Function (anonymous)],
  errors: [
    {
      validation: 'regex',
      code: 'invalid_string',
      message: 'Invalid',
      path: []
    }
  ]
}

Setting it to "latest" works fine so I guess something is broken with the regex:

      - uses: prefix-dev/setup-pixi@v0.2.0
        with:
          pixi-version: latest
          cache: true
pavelzw commented 1 year ago

The versions that you should use are the tag names of the pixi repo. image The regex I used was v\d+\.\d+\.\d+|latest.

If you use

      - uses: prefix-dev/setup-pixi@v0.2.0
        with:
          pixi-version: v0.2.0
          cache: true

it should work. But yeah, the error message could be improved.

Hofer-Julian commented 1 year ago

I see. Maybe the example in the README should then be adjusted? :)

pavelzw commented 1 year ago

Oh I didn't check that the examples in the readme actually work 😅 I only checked this

pavelzw commented 1 year ago

The error message looks like this now:

image