Skip to content

Commit 6fdf663

Browse files
Fix: use PyPI REST API directly for yank (twine doesn't support yank)
1 parent 8ec28ab commit 6fdf663

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

.github/workflows/test_pypi_yank.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,19 @@ jobs:
1515

1616
- name: Attempt to yank policyengine-uk 0.35.0
1717
env:
18-
TWINE_USERNAME: __token__
19-
TWINE_PASSWORD: ${{ secrets.PYPI }}
18+
PYPI_TOKEN: ${{ secrets.PYPI }}
2019
run: |
21-
pip install twine
22-
twine yank policyengine-uk 0.35.0 --reason "Test: verifying org secret has yank permissions" || echo "YANK FAILED (exit $?)"
20+
STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
21+
-X POST "https://pypi.org/pypi/policyengine-uk/0.35.0/yank" \
22+
-H "Authorization: Bearer $PYPI_TOKEN" \
23+
-d "reason=Test%3A+verifying+org+secret+has+yank+permissions")
24+
echo "HTTP status: $STATUS"
25+
if [ "$STATUS" = "200" ]; then
26+
echo "YANK SUCCEEDED - token has yank permissions"
27+
elif [ "$STATUS" = "403" ]; then
28+
echo "YANK FAILED 403 - token lacks permission or wrong scope"
29+
elif [ "$STATUS" = "401" ]; then
30+
echo "YANK FAILED 401 - token authentication failed"
31+
else
32+
echo "YANK FAILED with unexpected status $STATUS"
33+
fi

0 commit comments

Comments
 (0)