Skip to content

Commit

Permalink
fix(action): fix check package versions
Browse files Browse the repository at this point in the history
  • Loading branch information
pchorus committed Apr 23, 2024
1 parent 91b47c2 commit 83ea446
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ runs:
- name: Check for invalid package versions in pyproject.toml
run: |
poetry install --directory ${{ github.action_path }}
poetry run --directory ${{ github.action_path }} invalid_package_versions
poetry install
poetry run invalid_package_versions ${{ inputs.working_directory }}/pyproject.toml
shell: bash
working-directory: ${{ github.workspace }}
working-directory: ${{ github.action_path }}

- name: Create virtualenv and install dependencies
shell: bash
Expand Down
3 changes: 2 additions & 1 deletion action_setup_python_poetry/invalid_package_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def get_invalid_package_versions(pyproject_toml_file_text: str) -> Sequence[tupl


def main():
if invalid_versions := get_invalid_package_versions(Path("pyproject.toml").read_text()):
pyproject_path = Path(sys.argv[1] if len(sys.argv) > 1 else "pyproject.toml")
if invalid_versions := get_invalid_package_versions(pyproject_path.read_text()):
print(f"Invalid package versions found in pyproject.toml: {invalid_versions}")
sys.exit(1)

Expand Down

0 comments on commit 83ea446

Please sign in to comment.