Skip to content

Commit

Permalink
Prevent failure exit code in Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscarrollsmith committed Nov 6, 2024
1 parent fb1c195 commit f10df13
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ jobs:
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
output=$(poetry publish --build -u __token__ -p $PYPI_TOKEN 2>&1)
if [ $? -ne 0 ]; then
# Attempt to publish and capture output
if poetry publish --build -u __token__ -p $PYPI_TOKEN 2>&1; then
echo "Package published successfully"
else
echo "::warning::Version has not been incremented. No new version published."
echo "$output"
fi
# Ensure step exits successfully
exit 0

0 comments on commit f10df13

Please sign in to comment.