Skip to content

Commit 0cac909

Browse files
committed
remove cleanup
1 parent 33cd162 commit 0cac909

File tree

1 file changed

+44
-44
lines changed

1 file changed

+44
-44
lines changed

.github/workflows/pr-preview.yml

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -377,33 +377,33 @@ jobs:
377377
body: comment
378378
});
379379
380-
cleanup-preview:
381-
runs-on: ubuntu-latest
382-
if: github.event.action == 'closed'
383-
steps:
384-
- name: Log in to GitHub Container Registry
385-
uses: docker/login-action@v3
386-
with:
387-
registry: ghcr.io
388-
username: ${{ github.actor }}
389-
password: ${{ secrets.GITHUB_TOKEN }}
390-
391-
- name: Delete PR container images
392-
run: |
393-
# Delete container images for this PR
394-
PR_NUMBER=${{ github.event.number }}
395-
REPO_LOWER=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
396-
397-
# Get all tags for this PR and delete them
398-
for tag in $(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
399-
"https://api.github.com/orgs/${{ github.repository_owner }}/packages/container/${REPO_LOWER}%2Fwrongsecrets-pr/versions" | \
400-
jq -r --arg pr "$PR_NUMBER" '.[] | select(.metadata.container.tags[]? | contains($pr)) | .id'); do
401-
402-
echo "Deleting container version: $tag"
403-
curl -X DELETE \
404-
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
405-
"https://api.github.com/orgs/${{ github.repository_owner }}/packages/container/${REPO_LOWER}%2Fwrongsecrets-pr/versions/$tag"
406-
done
380+
# cleanup-preview:
381+
# runs-on: ubuntu-latest
382+
# if: github.event.action == 'closed'
383+
# steps:
384+
# - name: Log in to GitHub Container Registry
385+
# uses: docker/login-action@v3
386+
# with:
387+
# registry: ghcr.io
388+
# username: ${{ github.actor }}
389+
# password: ${{ secrets.GITHUB_TOKEN }}
390+
391+
# - name: Delete PR container images
392+
# run: |
393+
# # Delete container images for this PR
394+
# PR_NUMBER=${{ github.event.number }}
395+
# REPO_LOWER=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
396+
397+
# # Get all tags for this PR and delete them
398+
# for tag in $(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
399+
# "https://api.github.com/orgs/${{ github.repository_owner }}/packages/container/${REPO_LOWER}%2Fwrongsecrets-pr/versions" | \
400+
# jq -r --arg pr "$PR_NUMBER" '.[] | select(.metadata.container.tags[]? | contains($pr)) | .id'); do
401+
402+
# echo "Deleting container version: $tag"
403+
# curl -X DELETE \
404+
# -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
405+
# "https://api.github.com/orgs/${{ github.repository_owner }}/packages/container/${REPO_LOWER}%2Fwrongsecrets-pr/versions/$tag"
406+
# done
407407

408408
# Comment out Render cleanup for now
409409
# - name: Cleanup Render service
@@ -420,24 +420,24 @@ jobs:
420420
# -H "Authorization: Bearer $RENDER_API_KEY"
421421
# fi
422422

423-
- name: Comment PR closure
424-
uses: actions/github-script@v7
425-
with:
426-
script: |
427-
const comment = `🧹 **Preview Cleanup Complete**
423+
# - name: Comment PR closure
424+
# uses: actions/github-script@v7
425+
# with:
426+
# script: |
427+
# const comment = `🧹 **Preview Cleanup Complete**
428428

429-
PR preview resources have been cleaned up:
430-
- ✅ Container images deleted from GitHub Container Registry
431-
- ✅ Artifacts will expire automatically in 30 days
429+
# PR preview resources have been cleaned up:
430+
# - ✅ Container images deleted from GitHub Container Registry
431+
# - ✅ Artifacts will expire automatically in 30 days
432432

433-
Thanks for contributing to WrongSecrets! 🎉
433+
# Thanks for contributing to WrongSecrets! 🎉
434434

435-
---
436-
<sub>Cleanup completed by GitHub Actions</sub>`;
435+
# ---
436+
# <sub>Cleanup completed by GitHub Actions</sub>`;
437437

438-
github.rest.issues.createComment({
439-
issue_number: context.issue.number,
440-
owner: context.repo.owner,
441-
repo: context.repo.repo,
442-
body: comment
443-
});
438+
# github.rest.issues.createComment({
439+
# issue_number: context.issue.number,
440+
# owner: context.repo.owner,
441+
# repo: context.repo.repo,
442+
# body: comment
443+
# });

0 commit comments

Comments
 (0)