Skip to content

Commit

Permalink
Update ghost-inspector.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
oakesjosh committed Nov 4, 2024
1 parent 7df65bc commit 3155d50
Showing 1 changed file with 26 additions and 20 deletions.
46 changes: 26 additions & 20 deletions .github/workflows/ghost-inspector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,32 @@ jobs:
# Move zip back to workspace
mv ${{ env.PLUGIN_SLUG }}.zip $GITHUB_WORKSPACE/
- name: Upload plugin
run: |
# Upload plugin using the working format
UPLOAD_RESPONSE=$(curl -X POST \
-H "X-API-Key: ${{ env.WP_API_KEY }}" \
-F "plugin_zip=@${{ env.PLUGIN_SLUG }}.zip" \
-F "plugin_zip=@${{ env.PLUGIN_SLUG }}.zip;type=application/zip" \
-s \
"${{ env.WP_URL }}/wp-json/plugin-upload/v1/upload")
echo "Upload response: $UPLOAD_RESPONSE"
# Check if the request was successful using grep like the shell script
if echo "$UPLOAD_RESPONSE" | grep -q '"success":true'; then
echo "Plugin uploaded successfully!"
PLUGIN_DIR=$(echo "$UPLOAD_RESPONSE" | grep -o '"plugin_directory":"[^"]*"' | cut -d'"' -f4)
echo "Installed in directory: $PLUGIN_DIR"
else
echo "Failed to upload plugin"
echo "$UPLOAD_RESPONSE" | grep -o '"message":"[^"]*"' | cut -d'"' -f4
exit 1
fi
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.PLUGIN_SLUG }}
path: ${{ env.PLUGIN_SLUG }}.zip

# - name: Upload plugin
# run: |
# # Upload plugin using the working format
# UPLOAD_RESPONSE=$(curl -X POST \
# -H "X-API-Key: ${{ env.WP_API_KEY }}" \
# -F "plugin_zip=@${{ env.PLUGIN_SLUG }}.zip" \
# -F "plugin_zip=@${{ env.PLUGIN_SLUG }}.zip;type=application/zip" \
# -s \
# "${{ env.WP_URL }}/wp-json/plugin-upload/v1/upload")
# echo "Upload response: $UPLOAD_RESPONSE"
# # Check if the request was successful using grep like the shell script
# if echo "$UPLOAD_RESPONSE" | grep -q '"success":true'; then
# echo "Plugin uploaded successfully!"
# PLUGIN_DIR=$(echo "$UPLOAD_RESPONSE" | grep -o '"plugin_directory":"[^"]*"' | cut -d'"' -f4)
# echo "Installed in directory: $PLUGIN_DIR"
# else
# echo "Failed to upload plugin"
# echo "$UPLOAD_RESPONSE" | grep -o '"message":"[^"]*"' | cut -d'"' -f4
# exit 1
# fi

- name: Run Ghost Inspector tests
run: |
Expand Down

0 comments on commit 3155d50

Please sign in to comment.