Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Can't use an array of strings with runs-on #37

Closed
patrickconroy opened this issue Mar 21, 2025 · 3 comments · Fixed by #38
Closed

Bug: Can't use an array of strings with runs-on #37

patrickconroy opened this issue Mar 21, 2025 · 3 comments · Fixed by #38
Assignees
Labels
bug Something isn't working

Comments

@patrickconroy
Copy link

patrickconroy commented Mar 21, 2025

Hello. Seems something is off with the NormalJob['runs-on'] type.

This no longer works:

export const tmp = () => new NormalJob('test', {
    'runs-on': ['linux', 'self-hosted'],
});

It worked correctly in 0.3.0, no longer in latest.

Thanks.

@emmanuelnk emmanuelnk added the bug Something isn't working label Mar 24, 2025
@emmanuelnk emmanuelnk self-assigned this Mar 24, 2025
@emmanuelnk
Copy link
Owner

Will take a look today. Could possibly be because of a recent schema change.

@emmanuelnk
Copy link
Owner

emmanuelnk commented Mar 24, 2025

The problem is indeed the source JSON Schema. It's missing a certain property that leads to the generation of a bad type. I've confirmed that with this property present, the correct type is generated. Thanks for bringing this up.

I've created a PR (SchemaStore/schemastore#4617) via SchemaStore/schemastore

In the meantime, this can be hackily fixed with typecasting (e.g. as unknown as string) on the runs-on array. Will update the package once my PR is accepted.

@emmanuelnk
Copy link
Owner

@patrickconroy fixed in v1.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants