feat: Disable writing Python bytecode #1152
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Permission issues can occur on the Python bytecode files as the container entrypoint is being run as the root user. When e.g. using a custom parser the bytecode file will be owned by the root user instead of the user running the action.
This can cause subsequent steps to fail.
For example when running actions/checkout after python-semantic-release it will try to do a
git clean -ffdx
which will fail to remove the pyc file.Rationale
This could probably also be avoided by running the entrypoint as a non privileged user, but this would require using sudo or alternative solutions for running e.g. the
git config --system
command.In general the usage of the root user isn't really a problem for this action so this seems to be the most straightforward way to workaound the permission issues.
How did you test?
How to Verify
See linked actions in testing section.