Skip to content

'str' object has no attribute 'path' #11

@yegor256

Description

@yegor256

This is my YAML config:

name: scancode
'on':
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
jobs:
  scancode:
    timeout-minutes: 15
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v4
        with:
          path: scancode-inputs
      - uses: aboutcode-org/scancode-action@alpha
        with:
          inputs-path: scancode-inputs
          pipelines: "scan_codebase"
          output-formats: "json xlsx spdx cyclonedx"

I'm getting this:

INFO Run[c911c374-3a49-4ba8-a580-6332d024d1dd] Enter `execute_pipeline_task` Run.pk=c911c374-3a49-4ba8-a580-6332d024d1dd
INFO Run[c911c374-3a49-4ba8-a580-6332d024d1dd] Run pipeline: "scan_codebase" on project: "scancode-action"
INFO Scan 127 codebase resources with scan_for_package_data
INFO Starting ProcessPoolExecutor with 3 max_workers
Start the scan_codebase pipeline execution...
INFO Project scancode-action assemble_packages:
INFO   Processing: pom.xml
INFO   Package data: pkg:maven/com.jcabi.incubator/xembly@1.0-SNAPSHOT
INFO   Selected package handler: MavenPomXmlHandler
INFO     Processing item: Package(type='maven', namespace='com.jcabi.incubator', name='xembly', version='1.0-SNAPSHOT', datasource_id='maven_pom')
INFO Run[c911c374-3a49-4ba8-a580-6332d024d1dd] Update Run instance with exitcode, output, and end_date
CommandError: Error during scan_codebase execution:
'str' object has no attribute 'path'

Traceback:
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/aboutcode/pipeline/__init__.py", line 199, in execute
    step(self)
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/scanpipe/pipelines/scan_codebase.py", line 63, in scan_for_application_packages
    scancode.scan_for_application_packages(self.project, progress_logger=self.log)
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/scanpipe/pipes/scancode.py", line 436, in scan_for_application_packages
    assemble_packages(project=project)
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/scanpipe/pipes/scancode.py", line 493, in assemble_packages
    for item in items:
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/packagedcode/maven.py", line 94, in assemble
    yield from MavenPomXmlHandlerMixin.assemble(package_data, resource, codebase)
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/packagedcode/models.py", line 1185, in assemble
    cls.assign_package_to_resources(
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/packagedcode/maven.py", line 294, in assign_package_to_resources
    return models.DatafileHandler.assign_package_to_resources(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/packagedcode/models.py", line 1224, in assign_package_to_resources
    if resource.path.endswith("-extract"):
       ^^^^^^^^^^^^^

Full story is here: https://github.com/yegor256/xembly/actions/runs/13442374348/job/37559683755

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions