Skip to content

Instantly share code, notes, and snippets.

@detj
Last active September 23, 2025 14:00
Show Gist options
  • Select an option

  • Save detj/87ae6a8884c35c832a265fbea447c16c to your computer and use it in GitHub Desktop.

Select an option

Save detj/87ae6a8884c35c832a265fbea447c16c to your computer and use it in GitHub Desktop.
Delete unused Cloud Run revisions
# 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