{"id":24965725,"url":"https://github.com/shiftcode/delete-cfn-stacks-action","last_synced_at":"2025-07-06T20:38:56.117Z","repository":{"id":89447374,"uuid":"353341888","full_name":"shiftcode/delete-cfn-stacks-action","owner":"shiftcode","description":"github workflow action to delete aws cloudformation stacks","archived":false,"fork":false,"pushed_at":"2024-01-26T12:36:59.000Z","size":1660,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-29T01:19:18.421Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shiftcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-31T12:03:33.000Z","updated_at":"2023-03-23T08:48:13.000Z","dependencies_parsed_at":"2024-01-26T13:58:44.004Z","dependency_job_id":null,"html_url":"https://github.com/shiftcode/delete-cfn-stacks-action","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/shiftcode/delete-cfn-stacks-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiftcode%2Fdelete-cfn-stacks-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiftcode%2Fdelete-cfn-stacks-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiftcode%2Fdelete-cfn-stacks-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiftcode%2Fdelete-cfn-stacks-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shiftcode","download_url":"https://codeload.github.com/shiftcode/delete-cfn-stacks-action/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiftcode%2Fdelete-cfn-stacks-action/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262564647,"owners_count":23329539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-03T11:15:18.084Z","updated_at":"2025-07-06T20:38:56.075Z","avatar_url":"https://github.com/shiftcode.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Delete CloudFormation stacks action\n![version](https://img.shields.io/github/last-commit/shiftcode/delete-cfn-stacks-action)\n![version](https://img.shields.io/github/tag/shiftcode/delete-cfn-stacks-action?label=version)\n\n\nThis action deletes all cloudformation xx/pr stacks in the provided region with the given name prefix + the stage suffix. \nThe stage is transformed from the branch name (eg. `#85-my-feature` \u003e `xx85` / `pr85`). Production branch (`master` | `main`) branch \nis always ignored.\n\nMake sure your CloudFormation Stacks are fully deletable (if autoDeleteBuckets=true also autoDeleteItems, etc.)\n\n## Usage\n### Inputs\n\n#### `stackNamePrefix`\n**Required** `string` The prefix of the stack names to delete.\n\n#### `waitForDeleteComplete`\n**Optional** `boolean` Whether the action should wait until the stack is completely deleted (status=`DELETE_COMPLETE`).\n\n#### `ignoreBranches`\n**Optional** `JSON String Array` branches to ignore (early exit, necessary since on-delete workflows do not support branch restrictions). \nProduction branches (`master` | `main`) branch is always ignored.\n\n\n### Example workflow step config\n```\n- name: Configure AWS Credentials\n  uses: aws-actions/configure-aws-credentials@v4\n  with:\n    role-to-assume: 'arn:aws:iam::{ACCOUNT_ID}:role/{ROLE_NAME}'\n    aws-region: eu-central-1\n- name: Delete Stacks\n  uses: shiftcode/delete-cfn-stacks-action@v0.0.X\n  with:\n    stackNamePrefix: 'ch-website'\n    waitForDeleteComplete: true\n    # master \u0026 main are ignored by default\n    ignoreBranches: '[\"#1-dev\"]'\n```\n### Hints\n- If there are stacks in multiple regions: use both actions two times with their corresponding region.\n- If working with `assumedRoles` and [`aws-actions/configure-aws-credentials@v1`](https://github.com/aws-actions/configure-aws-credentials) the policy statement for the static iam user needs to have the actions `\"sts:AssumeRole` AND `sts:TagSession` allowed on the role to assume. \nThe Trust relationship of the assumed role needs to allow those actions for the assuming user. \n\n## Development\n### testing\nTo test the action locally: call `index.js` with env var `INPUT_STACKNAMEPREFIX`\n--\u003e `INPUT_STACKNAMEPREFIX=\"bag-covid19\" node ./dist/index.js`\n### new version\n1) implement your changes\n2) commit with `npx commit`\n3) set tag `git tag -a -m \"my fancy release\" v0.0.X`\n4) push with tags `git push --follow-tags`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiftcode%2Fdelete-cfn-stacks-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshiftcode%2Fdelete-cfn-stacks-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiftcode%2Fdelete-cfn-stacks-action/lists"}