mit einem Klick
cleanup-test-data
// Clean up GitHub resources created by the-power test environment scripts. Delete repositories, teams, members, rulesets, webhooks, environments, and other resources. Suspend or unsuspend users on GHES.
// Clean up GitHub resources created by the-power test environment scripts. Delete repositories, teams, members, rulesets, webhooks, environments, and other resources. Suspend or unsuspend users on GHES.
Configure the-power for a target GitHub instance. Run configure.py to generate .gh-api-examples.conf with hostname, token, org, repo, and other settings. Covers interactive and non-interactive setup, GHES vs dotcom differences, curl flags for self-signed certs, and GitHub App configuration.
Create a fully populated test organisation on a GitHub instance using the-power's build-all.sh script. Includes users, teams, repos, PRs, branch protection, and more. Requires .gh-api-examples.conf to be configured first.
Create a test repository using the-power's build-testcase scripts. Covers the full decision matrix of 30+ testcase scripts for repos with PRs, issues, workflows, secret scanning, rulesets, runners, and more.
Find the right the-power script by category, keyword, or goal. Covers all ~980 scripts organised by operation type with safety labels for destructive, GHES-only, and bulk operations.
Execute any the-power script with guided parameter input. Covers prerequisites, working directory, output interpretation, HTTP status codes, error patterns, and debugging techniques.
Scale up a test environment by bulk-creating repos, users, orgs, teams, issues, branches, PRs, and commits using the-power's create-many scripts. Three performance tiers: shell, Python connection reuse, and Python pooling.
| name | cleanup-test-data |
| description | Clean up GitHub resources created by the-power test environment scripts. Delete repositories, teams, members, rulesets, webhooks, environments, and other resources. Suspend or unsuspend users on GHES. |
| keywords | ["cleanup","delete","remove","destroy","teardown","suspend","unsuspend"] |
Remove resources created by the-power scripts.
All cleanup scripts must be run from the root of a the-power clone.
Find an existing clone:
find ~ -maxdepth 5 -name "delete-repo.sh" -path "*/the-power/*" 2>/dev/null
.gh-api-examples.conf points at the correct server.org and repo values before deleting.The fastest way to clean up everything is to delete the entire org:
curl -X DELETE \
-H "Authorization: token ${GITHUB_TOKEN}" \
"${GITHUB_API_BASE_URL}/orgs/${org}"
This removes the org and all its repos, teams, and other resources.
| Script | Description |
|---|---|
delete-repo.sh [repo] | Delete a repository from ${org} |
delete-a-file.sh | Delete a single file |
| Script | Description |
|---|---|
delete-team.sh <team_slug> | Delete a team |
delete-many-teams.sh | Delete all teams in nato-alphabet.txt |
delete-team-member.sh | Remove a team member |
| Script | Description |
|---|---|
delete-branch-protection.sh | Remove branch protection |
delete-a-repository-ruleset.sh | Delete a repo ruleset |
delete-an-organization-repository-ruleset.sh | Delete an org ruleset |
| Script | Description |
|---|---|
delete-webhook.sh | Delete a repo webhook |
delete-an-organization-webhook.sh | Delete an org webhook |
| Script | Description |
|---|---|
delete-environment.sh [env] [repo] | Delete an environment |
delete-a-deployment.sh | Delete a deployment |
| Script | Description |
|---|---|
delete-an-organization-secret.sh | Delete an org secret |
delete-a-repository-variable.sh | Delete a repo variable |
delete-a-deploy-key.sh | Delete a deploy key |
| Script | Description |
|---|---|
delete-a-release-asset.sh | Delete a release asset |
delete-a-milestone.sh | Delete a milestone |
delete-a-reference.sh | Delete a git reference |
delete-a-code-scanning-analysis-from-a-repository.sh | Delete a code scanning analysis |
| Script | Description |
|---|---|
suspend-a-user.sh [username] | Suspend a user on GHES |
unsuspend-a-user.sh [username] | Unsuspend a user on GHES |
./delete-repo.sh my-test-repo # delete a specific repo
./delete-team.sh alpha # delete a team
./delete-environment.sh staging my-repo # delete an environment
./suspend-a-user.sh testuser # suspend a GHES user
delete_repo or admin:org scope.hostname and org values.