Skip to content

Commit

Permalink
Replace set-output to $GITHUB_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
cuicaihao committed Mar 23, 2024
1 parent 08ed780 commit 0b9ac2b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/python-CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,21 @@ jobs:
- name: Get Package version
id: get_version
run: |
echo ::set-output name=version::$(python setup.py --version)
echo "version=$(python setup.py --version)" >> $GITHUB_ENV
- name: Check if release exists
id: check_release
run: |
RELEASE_ID=$(curl --silent --show-error --location --fail --retry 3 --output /dev/null --write-out "%{http_code}" --header "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ steps.get_version.outputs.version }}")
echo "::set-output name=exists::$([[ "$RELEASE_ID" != "404" ]] && echo true || echo false)"
echo "exists=$([[ "$RELEASE_ID" != "404" ]] && echo true || echo false)" >> $GITHUB_ENV
- name: Create Release
id: create_release
if: ${{ !steps.check_release.outputs.exists }}
if: ${{ !env.exists }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.version }}
release_name: Release ${{ steps.get_version.outputs.version }}
tag_name: ${{ env.version }}
release_name: Release ${{ env.version }}
draft: false
prerelease: false

Expand Down

0 comments on commit 0b9ac2b

Please sign in to comment.