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] timeout-minutes should allow expressions (but it demands floats) #384

Closed
webknjaz opened this issue Dec 14, 2023 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@webknjaz
Copy link

The same problem has just been fixed in the jsonschema based linter: python-jsonschema/check-jsonschema#354.

TL;DR the field should be either an expression or an integer. I don't think GHA actually allows floats in there like the error implies:

$ pre-commit run actionlint-docker --all-files -v 
Lint GitHub Actions workflow files.......................................Failed
- hook id: actionlint-docker
- duration: 1.03s
- exit code: 1

.github/workflows/reusable-build-wheel.yml:42:22: type of expression at "float number value" must be number but found type string [expression]
   |
42 |     timeout-minutes: ${{ inputs.qemu && 60 || 20 }}
   |                      ^~~
webknjaz added a commit to aio-libs/frozenlist that referenced this issue Dec 14, 2023
The `timeout-minutes` value can be an expression or an integer.

Ref: rhysd/actionlint#384
webknjaz added a commit to aio-libs/yarl that referenced this issue Dec 15, 2023
This only ignores one false-positive linting rule.

Ref: rhysd/actionlint#384
@rhysd
Copy link
Owner

rhysd commented Mar 6, 2024

on: push
jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: ${{ true && 60 || 20 }}
    steps:
      - run: echo hello

I tried this workflow and actionlint reported no error. What is the type of inputs.qemu?

@webknjaz
Copy link
Author

webknjaz commented Mar 6, 2024

@rhysd
Copy link
Owner

rhysd commented May 2, 2024

Thanks. I could reproduce it.

on: push
jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: ${{ '...' && 60 || 20 }}
    steps:
      - run: echo hello

@rhysd rhysd added the bug Something isn't working label May 2, 2024
@rhysd rhysd closed this as completed in 9b06616 May 3, 2024
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

No branches or pull requests

2 participants