peterus / platformio_dependabot

MIT License
6 stars 4 forks source link

Still doesn't work if project is in subpath #3

Open DiverOfDark opened 1 year ago

DiverOfDark commented 1 year ago

Hi, even after specifying project_path - it doesn't work.

After downloading all libraries here's what in log:

...
Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Library Manager: AsyncTCP-esphome@2.0.1 has been installed!
[I] getting data from PlatformIO, this will take a while...
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/app/platformio_dependabot/__main__.py", line 47, in <module>
    main()
  File "/app/platformio_dependabot/__main__.py", line 22, in main
    packages = get_outdated_libraries(config.project_path)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/platformio_dependabot/platformio.py", line 25, in get_outdated_libraries
    candidates = fetch_outdated_candidates(project_path, [])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/platformio/package/commands/outdated.py", line 131, in fetch_outdated_candidates
    config.validate(environments)
  File "/usr/local/lib/python3.11/site-packages/platformio/project/config.py", line 398, in validate
    raise exception.NotPlatformIOProjectError(os.path.dirname(self.path))
platformio.project.exception.NotPlatformIOProjectError: Not a PlatformIO project. `platformio.ini` file has not been found in current working directory (/github/workspace). To initialize new project please use `platformio project init` command
[I] Execution took 91 seconds
DiverOfDark commented 1 year ago
peterus commented 1 year ago

Sorry for the existing issue. I just pushed a new version, can you please retest? thanks!

DiverOfDark commented 1 year ago

Thanks a lot, now much better, but probably I have some misconfig, could you help or any ideas where to check?

Workflow is defined as this: https://github.com/DiverOfDark/KNOMI/blob/master/.github/workflows/dependabot.yml

and this is part of logs from actions:

[I] Updating 'ESPAsyncWebServer-esphome' to 3.1.0 ...
Traceback (most recent call last):
  File "<frozen runpy>", line [198](https://github.com/DiverOfDark/KNOMI/actions/runs/6166147783/job/16735150125#step:4:199), in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/app/platformio_dependabot/__main__.py", line 48, in <module>
    main()
  File "/app/platformio_dependabot/__main__.py", line 42, in main
    add_file_commit_and_push(repo, branch_name, config.platformio_ini, package)
  File "/app/platformio_dependabot/mygit.py", line 19, in add_file_commit_and_push
    repo.git(**{}).push(['--set-upstream', 'origin', branch_name])
  File "/usr/local/lib/python3.11/site-packages/git/cmd.py", line 739, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/git/cmd.py", line 1315, in _call_process
    return self.execute(call, **exec_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/git/cmd.py", line 1110, in execute
    raise GitCommandError(redacted_command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git push --set-upstream origin platformio_dependabot/ESPAsyncWebServer-esphome/3.1.0
  stderr: 'remote: Permission to DiverOfDark/KNOMI.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/DiverOfDark/KNOMI/': The requested URL returned error: 403'
DiverOfDark commented 1 year ago

Figured it out - I was missing configuration in repo settings:

image
DiverOfDark commented 1 year ago

https://github.com/DiverOfDark/KNOMI/pull/7

Looks like almost works - but actual platformio.ini wasn't committed?