Skip to content

secretlinter and jscpd run ordrer is not respected #3979

Description

@lvjp

Describe the bug
Sporadically, when jscpd and secretlinter are run in parallel, you can encounter this error :

[Error: ENOENT: no such file or directory, open '/github/workspace/megalinter-reports/copy-paste/html/jscpd-report.json'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/github/workspace/megalinter-reports/copy-paste/html/jscpd-report.json'
}

To Reproduce
Run a lot of time megalinter

Expected behavior
Only run secretlinter after a successful run of jscpd

Screenshots

2024-09-09T13:21:14.0247818Z Processing linters on [4] parallel cores… (can be decreased with variable PARALLEL_PROCESS_NUMBER in case of performance issues)
2024-09-09T13:21:15.4280679Z ##[group]�[32m✅ Linted [MARKDOWN] files with [markdown-link-check] successfully - (0.76s)�[0m (expand for details)
2024-09-09T13:21:15.4283160Z - Using [markdown-link-check v3.12.2] https://megalinter.io/8.0.0/descriptors/markdown_markdown_link_check
2024-09-09T13:21:15.4284636Z - MegaLinter key: [MARKDOWN_MARKDOWN_LINK_CHECK]
2024-09-09T13:21:15.4285628Z - Rules config: [.markdown-link-check.json]
2024-09-09T13:21:15.4286686Z - Number of files analyzed: [1]
2024-09-09T13:21:15.4287796Z ##[endgroup]
2024-09-09T13:21:15.4784250Z ##[group]�[32m✅ Linted [REPOSITORY] files with [devskim] successfully - (1.25s)�[0m (expand for details)
2024-09-09T13:21:15.4796006Z - Using [devskim v1.0.33] https://megalinter.io/8.0.0/descriptors/repository_devskim
2024-09-09T13:21:15.4797212Z - MegaLinter key: [REPOSITORY_DEVSKIM]
2024-09-09T13:21:15.4798234Z - Rules config: [.devskim.json]
2024-09-09T13:21:15.4799303Z ##[endgroup]
2024-09-09T13:21:16.0565321Z ##[group]�[32m✅ Linted [COPYPASTE] files with [jscpd] successfully - (1.26s)�[0m (expand for details)
2024-09-09T13:21:16.0623931Z - Using [jscpd v4.0.5] https://megalinter.io/8.0.0/descriptors/copypaste_jscpd
2024-09-09T13:21:16.0625633Z - MegaLinter key: [COPYPASTE_JSCPD]
2024-09-09T13:21:16.0626460Z - Rules config: [.jscpd.json]
2024-09-09T13:21:16.0627661Z ##[endgroup]
2024-09-09T13:21:16.5622894Z ##[group]�[31m❌ Linted [REPOSITORY] files with [secretlint]: Found 1 error(s) - (0.63s)�[0m (expand for details)
2024-09-09T13:21:16.5625067Z - Using [secretlint v8.2.4] https://megalinter.io/8.0.0/descriptors/repository_secretlint
2024-09-09T13:21:16.5626366Z - MegaLinter key: [REPOSITORY_SECRETLINT]
2024-09-09T13:21:16.5627249Z - Rules config: [.secretlintrc.json]
2024-09-09T13:21:16.5628121Z --Error detail:
2024-09-09T13:21:16.5629474Z [Error: ENOENT: no such file or directory, open '/github/workspace/megalinter-reports/copy-paste/html/jscpd-report.json'] {
2024-09-09T13:21:16.5630885Z   errno: -2,
2024-09-09T13:21:16.5631570Z   code: 'ENOENT',
2024-09-09T13:21:16.5632194Z   syscall: 'open',
2024-09-09T13:21:16.5633206Z   path: '/github/workspace/megalinter-reports/copy-paste/html/jscpd-report.json'
2024-09-09T13:21:16.5634769Z }
2024-09-09T13:21:16.5635007Z 
2024-09-09T13:21:16.5635717Z ##[endgroup]

Additional context
I run megalinter on GitHub Actions with this configuration :

permissions: {}

jobs:
  mega-linter:
    runs-on: ubuntu-22.04

    steps:
      - name: Checkout Code
        uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

      - name: MegaLinter
        id: ml
        uses: oxsecurity/megalinter@c217fe8f7bc9207062a084e989bd97efd56e7b9a # v8.0.0
        env:
          VALIDATE_ALL_CODEBASE: true
          # GO needs go1.23 which is not supported
          # SPELL is a little bit tricky
          DISABLE: GO,SPELL

      - name: Archive Megalinter artifacts
        if: success() || failure()
        uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
        with:
          name: MegaLinter reports
          path: |
            megalinter-reports
            mega-linter.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions