Last active
September 23, 2025 14:00
-
-
Save detj/87ae6a8884c35c832a265fbea447c16c to your computer and use it in GitHub Desktop.
Delete unused Cloud Run revisions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This command keeps the last 5 revisions and deletes the rest. | |
| # --quiet - do not prompt for (Y/n) | |
| # Replace <name> with the name of of the Cloud Run service | |
| # | |
| # Depending on the count of unused revisions this operation will | |
| # take a few minutes to complete. | |
| gcloud run revisions list --service=<name> --format="value(metadata.name)" | tail -n +6 | xargs -n1 gcloud run revisions delete --quiet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment