Skip to content

fix link microsoft

fix link microsoft #24

name: Cleanup PR Deployment
on:
pull_request:
types: [closed, synchronize]
jobs:
delete-preview-deployment:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get application ID of PR
run: |
RESPONSE=$(curl -X GET \
-H "Authorization: Bearer ${{ secrets.WATCHDOG_API_KEY }}" \
"https://watchdog.svuit.org/application_id?repo_name=${{ github.repository }}&pr_number=${{ github.event.pull_request.number }}")
echo "API Response: $RESPONSE"
APPLICATION_ID=$(echo "$RESPONSE" | jq -r '.application_id')
echo "APPLICATION_ID=$APPLICATION_ID" >> $GITHUB_ENV
- name: Call Appwrite API to delete application
run: |
RESPONSE=$(curl -s -X POST "https://67d5bb8cc07395d8f67a.appwrite.global/delete-application" -d '{
"applicationId": "${{ env.APPLICATION_ID }}"
}')
echo "Delete successful with response: $RESPONSE and application ID: $APPLICATION_ID"
delete-package:
runs-on: ubuntu-latest
if: github.event.action == 'closed'
steps:
- name: Delete GitHub Package
run: |
RESPONSE=$(curl -X DELETE \
-H "Authorization: Bearer ${{secrets.TOKEN}}" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/users/${{ github.repository_owner }}/packages/container/${{ github.event.repository.name }}%2Fpr-${{ github.event.pull_request.number }}")
echo "API Response: $RESPONSE"
if echo "$RESPONSE" | jq -e .message >/dev/null 2>&1; then
echo "Error: $(echo "$RESPONSE" | jq -r '.message')"
exit 1
fi