Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(action): use setup python poetry action #31

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 6 additions & 23 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,15 @@ runs:
using: "composite"

steps:
- name: Determine Python version
id: detect-versions
shell: bash
working-directory: ${{ github.action_path }}
run: |
if [ -z "${{ inputs.python_version }}" ] ; then
PYTHON_VERSION="$(sed -n -e '/^\[metadata\]/,/^\[/p' poetry.lock | sed -n -e 's/^python-versions[[:space:]]*=[[:space:]]*//p' | tr -d \"'[:space:]'\'~^)"
else
PYTHON_VERSION="${{ inputs.python_version }}"
fi

echo "python-version=$PYTHON_VERSION" >> $GITHUB_OUTPUT


- name: Setup Python
uses: actions/setup-python@v4
- uses: moneymeets/action-setup-python-poetry@master
with:
python-version: '${{ steps.detect-versions.outputs.python-version }}'

# Build and install "merge-checks" project from pyproject.toml in current directory
- run: pip install .
shell: bash
working-directory: ${{ github.action_path }}
working_directory: ${{ github.action_path }}
# ToDo: Re-enable cache when https://github.com/actions/setup-python/issues/361 is fixed
poetry_cache_enabled: 'false'

- run: merge_checks_runner
- run: poetry run --directory ${{ github.action_path }} merge_checks_runner
shell: bash
working-directory: ${{ github.workspace }}
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
HEAD_SHA: ${{ inputs.head_sha }}