update #1
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
| name: Delete GitHub Repo | |
| on: | |
| push: | |
| branches: | |
| - jribbink/delete-homebrew-hack | |
| jobs: | |
| delete_repo: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Delete GitHub repository | |
| env: | |
| GH_TOKEN: ${{ secrets.COMMITTER_TOKEN }} # Inject your custom token here | |
| REPO_OWNER: IT-Flow-Service-Account | |
| REPO_NAME: homebrew-core | |
| run: | | |
| echo "🔴 Attempting to delete repository: $REPO_OWNER/$REPO_NAME" | |
| response=$(curl -s -o /dev/null -w "%{http_code}" -X DELETE \ | |
| -H "Authorization: token $GH_TOKEN" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| "https://api.github.com/repos/$REPO_OWNER/$REPO_NAME") | |
| if [ "$response" == "204" ]; then | |
| echo "✅ Repository $REPO_OWNER/$REPO_NAME successfully deleted." | |
| else | |
| echo "❌ Failed to delete repo. HTTP status: $response" | |
| exit 1 | |
| fi |