Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/cleanup-old-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
env:
MIN_VERSIONS_TO_KEEP: ${{ github.event.inputs.min_versions_to_keep }}
PACKAGE_NAME: ${{ github.event.inputs.package_name }}
GH_TOKEN: ${{ secrets.GHCR_CLEANUP_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default GITHUB_TOKEN has limited permissions by default. Verify that the workflow has the packages: write permission granted in the workflow permissions section to successfully delete package versions. Without explicit permission grants, this token may lack sufficient privileges for package deletion operations.

Suggested change
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ github.token }}

Copilot uses AI. Check for mistakes.
run: |
set -euo pipefail
echo "Preparing list of package:"$PACKAGE_NAME" ids to delete from ghcr.io..."
Expand Down Expand Up @@ -113,17 +113,19 @@ jobs:
- name: Cleanup old packages
if: ${{ github.event.inputs.dry_run != 'true' && steps.prepare-versions.outputs.package_version_ids != '' }}
uses: actions/delete-package-versions@e5bc658cc4c965c472efe991f8beea3981499c55 # v5.0.0
continue-on-error: true
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding continue-on-error: true masks failures during testing. While this might be intentional for the WIP phase, ensure this is removed before merging to production. Silent failures in cleanup operations could lead to package retention issues going unnoticed.

Copilot uses AI. Check for mistakes.
with:
package-name: '${{ github.event.inputs.package_name }}'
package-type: 'container'
package-version-ids: '${{ steps.prepare-versions.outputs.package_version_ids }}'
token: ${{ secrets.GHCR_CLEANUP_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Cleanup untagged packages
if: ${{ github.event.inputs.dry_run != 'true' }}
uses: actions/delete-package-versions@e5bc658cc4c965c472efe991f8beea3981499c55 # v5.0.0
continue-on-error: true
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding continue-on-error: true masks failures during testing. While this might be intentional for the WIP phase, ensure this is removed before merging to production. Silent failures in cleanup operations could lead to package retention issues going unnoticed.

Suggested change
continue-on-error: true

Copilot uses AI. Check for mistakes.
with:
package-name: '${{ github.event.inputs.package_name }}'
package-type: 'container'
token: ${{ secrets.GHCR_CLEANUP_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
delete-only-untagged-versions: true
Loading