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

mega-linter-runner --install generates invalid Github Actions workflow #1662

Closed
sammcj opened this issue Jul 28, 2022 · 1 comment · Fixed by #1673
Closed

mega-linter-runner --install generates invalid Github Actions workflow #1662

sammcj opened this issue Jul 28, 2022 · 1 comment · Fixed by #1673
Labels
bug Something isn't working

Comments

@sammcj
Copy link

sammcj commented Jul 28, 2022

Describe the bug

npx mega-linter-runner --install adds invalid characters to the generated Github Actions workflow yaml, resulting in Github rejecting the workflow.

Examples:

https://github.com/sammcj/sqs-message-action/actions/runs/2750875544/workflow#L43

To Reproduce
Steps to reproduce the behavior:

  1. npx mega-linter-runner --install
? What is your project type ? Let MegaLinter suggest to me later (recommended)
? What CI/CD system do you use ? GitHub Actions
? Do you want to detect excessive copy-pastes ? No
? Do you want to detect spelling mistakes ? No
? Which MegaLinter version do you want to use ? v6 (Latest official release)
? What is the name of your repository default branch ? main
? Do you want MegaLinter to validate all source code or only updated one ? Validate only sources diff with master/main branch
? Do you want to automatically apply formatting and auto-fixes (--fix option of linters) ? Yes
? Do you want MegaLinter to upload reports on file.io ? (report is deleted after being downloaded once) No
? Do you want to see elapsed time by linter in logs ? Yes
? Do you want to connect to OX Security to secure your repository ? No
  1. Open .github/workflows/mega-linter.yml
  2. See invalid characters on line 43

Expected behavior

No invalid characters / a working workflow

Screenshots

Screen Shot 2022-07-28 at 12 21 55 pm

Screen Shot 2022-07-28 at 12 20 10 pm

I believe what should be generated was:

 VALIDATE_ALL_CODEBASE: ${{ (github.event_name == 'push') && (github.ref == 'refs/heads/main') }}

Additional context

  • macOS 12.5
  • Standard English UTF8 charset
@sammcj sammcj added the bug Something isn't working label Jul 28, 2022
nvuillam added a commit that referenced this issue Jul 30, 2022
@nvuillam
Copy link
Member

Good catch, thanks for reporting :)

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