Delete Google Cloud Pub/Sub subscriptions.
- ✅ Delete Pub/Sub subscriptions by name
- ✅ Simple and straightforward operation
- ✅ Full validation and error handling
- name: Delete Pub/Sub Subscription
uses: predictr-io/gcp-pubsub-delete-subscription@v1
with:
project-id: 'my-gcp-project'
subscription-name: 'events-subscription'- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
- name: Delete Pub/Sub Subscription
uses: predictr-io/gcp-pubsub-delete-subscription@v1
with:
project-id: 'my-gcp-project'
subscription-name: 'temporary-subscription'jobs:
cleanup:
runs-on: ubuntu-latest
if: always()
steps:
- uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
- name: Delete Test Subscription
uses: predictr-io/gcp-pubsub-delete-subscription@v1
with:
project-id: 'my-gcp-project'
subscription-name: 'test-subscription-${{ github.run_id }}'| Input | Description | Required | Default |
|---|---|---|---|
project-id |
GCP project ID | Yes | - |
subscription-name |
Pub/Sub subscription name | Yes | - |
This action requires GCP authentication. Use the google-github-actions/auth action:
- uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}The service account needs:
pubsub.subscriptions.delete
Or the role: roles/pubsub.editor
- This operation cannot be undone
- If the subscription doesn't exist, the action will fail
- Deleting a subscription does not delete the topic
MIT