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

False positive with github actions yaml #666

Closed
dosas opened this issue Apr 3, 2024 · 3 comments
Closed

False positive with github actions yaml #666

dosas opened this issue Apr 3, 2024 · 3 comments

Comments

@dosas
Copy link

dosas commented Apr 3, 2024

---
on:
  push:
    tags: ['**']
...

When running

 yamllint --strict 

Actual:
warning truthy value should be one of [false, true] (truthy)

Expected:
No warning

@dosas
Copy link
Author

dosas commented Apr 3, 2024

@adrienverge Could you be a little bit more verbose about it?

@andrewimeson
Copy link
Contributor

@dosas this is an issue report with a lot of duplicates (e.g. #430). It's not a problem, it's intended default behavior.

Your options are:

  1. Quote the key

    ---
    name: Run tests
    
    "on": [push, pull_request]
  2. Disable the rule with a line comment

    ---
    name: Run tests
    
    on: [push, pull_request]  # yamllint disable-line rule:truthy
  3. Disable key checking in the yamllint configuration (e.g. .yamllint.yaml)

    ---
    extends: default
    rules:
      truthy:
        check-keys: false

@adrienverge
Copy link
Owner

Thanks @andrewimeson 🙏

Since #650 and yamllint 1.34.0 there is yet another solution: declare the YAML version explicitly:

%YAML 1.2
---
name: Run tests

on: [push, pull_request]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants