diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2020-12-06 12:12:12 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-06 12:12:12 -0500 |
commit | 43b0b81ed763d65f202f4373983c56ad4fb102ef (patch) | |
tree | a8aec2c7667982d12d6d082ae49848574225653d | |
parent | 43f76003c60d88bf9ff87cd39ae748bfb770234b (diff) | |
parent | 4a4d50af47c067eff372fd007123b62c25e5c6dd (diff) | |
download | python-setuptools-git-43b0b81ed763d65f202f4373983c56ad4fb102ef.tar.gz |
Merge pull request #2461 from webknjaz/testing/gha-fix-set-env-usage
Fix all deprecated set-env and add-path uses @ GHA
-rw-r--r-- | .github/workflows/python-tests.yml | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index b6640181..9dc4b9d7 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -57,19 +57,15 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true run: | from __future__ import print_function + import os python_version = '${{ env.PYTHON_VERSION }}'.replace('-beta', '') - print('::set-env name=PYTHON_VERSION::{ver}'.format(ver=python_version)) - print('::set-env name=USE_DEADSNAKES::true') + with open(os.environ['GITHUB_ENV'], 'a') as env_file: + env_file.write('PYTHON_VERSION={ver}\n'.format(ver=python_version)) + env_file.write('USE_DEADSNAKES=true\n') shell: python - name: Set up Python ${{ env.PYTHON_VERSION }} (deadsnakes) - uses: deadsnakes/action@v1.0.0 + uses: deadsnakes/action@v2.0.1 if: fromJSON(env.USE_DEADSNAKES) && true || false - # FIXME: drop once deadsnakes/action gets fixed - # Refs: - # * github.com/deadsnakes/issues/issues/135 - # * github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/ - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true with: python-version: ${{ env.PYTHON_VERSION }} - name: Set up Python ${{ env.PYTHON_VERSION }} @@ -110,13 +106,10 @@ jobs: python -m pip freeze --all - name: Adjust TOXENV for PyPy if: startsWith(env.PYTHON_VERSION, 'pypy') - # FIXME: replace `set-env` with a newer alternative - # Refs: - # * github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/ - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true run: >- - echo "::set-env name=TOXENV::${{ env.PYTHON_VERSION }}" + echo "TOXENV=${{ env.PYTHON_VERSION }}" + >> + "${GITHUB_ENV}" - name: Log env vars run: >- env |