Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where running the Python script directly with a version parameter fails due to unnecessary validation of file-related parameters. When a version is provided directly, the script should skip file-related validations since the version supersedes file parsing logic.
Key changes:
- Modified argument validation to skip file-related checks when version is provided
- Added integration test to verify the fix works correctly with the GitHub Action
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/get_cycle.py | Updated validation logic to only check file_path and related parameters when version is not supplied |
| .github/workflows/integrations-tests.yml | Added test case for Python version 2.7 to verify version-only usage works correctly |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Hi @MicahWW, thanks for opening the pull request. If I understand correctly, you want to fix this so it's easier to run the Python script directly, and not use it as a GitHub Action. I don't think this is a use-case I have considered. Could you provide any examples of why/when you would want to run it directly? |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
In the long run I am planning on just using your action but before I started using it I wanted to give the code a once over to see what was going on and what the expected output would be like before adding it to my repo, so I ran a test in my terminal which is when I noticed the issue and started working on a fix. TLDR: I don't plan on using the script directly, I just happened to stumble across the issue by chance. |
When using the Python script directly, instead of the Action, it will error because no file format is given.
This doesn't happen when using the action because a default file type of yaml is given.
endoflife-github-action/action.yml
Lines 19 to 22 in 6931ca6
The other options are not used when the version is defined, as seen in the get_product_cycle function below, so duplicating that logic on the option validation fixes the issue.
endoflife-github-action/src/get_cycle.py
Lines 19 to 29 in 6931ca6