fix: workflow permissions#18
Conversation
❌ 10 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
|
|
||
| python command_dump.py | ||
| git add codecovcli_commands | ||
| ./command_dump.py |
There was a problem hiding this comment.
In a previous commit I made this directly executable. Locally the hook won't run without this change for me. I think my PATH is bad for whatever reason when running this hook. Could probably fix that, but this is easier and shouldn't break for anyone else 🙈
There was a problem hiding this comment.
You need to change the file to be executable before committing (chmod u+x command_dump.py) I believe
There was a problem hiding this comment.
hmmm, even with that, it throws an error
--> ./command_dump.py
./command_dump.py: line 1: import: command not found
./command_dump.py: line 4: syntax error near unexpected token `('
./command_dump.py: line 4: `def command_dump(commands):'
I assume because it's not in a python shell
There was a problem hiding this comment.
command_dump.py has a shebang for python and is already executable - do you have latest main on this repo?
There was a problem hiding this comment.
strange, getting this error
tomhu@WLRW6YXHR9 [~/src/github/getsentry/prevent-cli] (main *)
--> ./command_dump.py
Dumping codecovcli
Dumping codecovcli create-commit
Dumping codecovcli create-report
Dumping codecovcli do-upload
Dumping codecovcli empty-upload
Dumping codecovcli pr-base-picking
Dumping codecovcli process-test-results
Dumping codecovcli send-notifications
Dumping codecovcli upload-coverage
Dumping codecovcli upload-process
Dumping sentry-prevent-cli
Traceback (most recent call last):
File "/Users/tomhu/src/github/getsentry/prevent-cli/./command_dump.py", line 35, in <module>
command_dump(["sentry-prevent-cli"], "prevent-cli/preventcli_commands")
File "/Users/tomhu/src/github/getsentry/prevent-cli/./command_dump.py", line 7, in command_dump
command_docs = subprocess.run(
^^^^^^^^^^^^^^^
File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/subprocess.py", line 548, in run
with Popen(*popenargs, **kwargs) as process:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/subprocess.py", line 1026, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/subprocess.py", line 1950, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'sentry-prevent-cli'
There was a problem hiding this comment.
I guess are we assuming someone already has sentry-prevent-cli installed?
There was a problem hiding this comment.
yes I guess it does assume that. It also assumes you have the codecov-cli installed. I'll add a check to the start of the script that checks for the executables and gives installation instructions otherwise.
9f2dfc5 to
fd92550
Compare
Fixes a bunch of errors in https://github.com/getsentry/prevent-cli/security/code-scanning
also tweaks the pre-commit hook to work with new command dump