fix: packagist publish — fix secrets condition and GitHub mirror URL #316

Merged
jmiller merged 1 commits from fix/packagist-publish into main 2026-06-23 22:06:37 +00:00
+3 -3
View File
@@ -52,15 +52,15 @@ jobs:
echo "Package available at: ${GITEA_URL}/api/packages/MokoConsulting/composer"
echo "Install: composer require mokoconsulting/mokocli"
# Packagist — notify of new version
# Packagist — notify of new version (points to GitHub mirror which Packagist can access)
- name: Notify Packagist
if: secrets.PACKAGIST_TOKEN != ''
if: ${{ secrets.PACKAGIST_TOKEN != '' }}
run: |
VERSION="${{ steps.version.outputs.version }}"
echo "Notifying Packagist of version ${VERSION}..."
curl -sf -X POST \
-H "Content-Type: application/json" \
-d '{"repository":{"url":"https://git.mokoconsulting.tech/MokoConsulting/mokocli"}}' \
-d '{"repository":{"url":"https://github.com/mokoconsulting-tech/mokocli"}}' \
"https://packagist.org/api/update-package?username=mokoconsulting&apiToken=${{ secrets.PACKAGIST_TOKEN }}" \
&& echo "Packagist notified" \
|| echo "::warning::Packagist notification failed (package may not be registered yet)"