Skip to content

Commit

Permalink
Gave the error to the robot and the robot rewrote it again
Browse files Browse the repository at this point in the history
  • Loading branch information
edgrosvenor committed Jan 18, 2025
1 parent 8af0c64 commit 4aca436
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }} # Automatically sets up push permissions

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -53,4 +55,4 @@ jobs:
if: success()
run: php artisan kibble:split
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13 changes: 2 additions & 11 deletions packages/kibble/src/Commands/SplitPackagesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ class SplitPackagesCommand extends Command

public function handle(): int
{
/** @phpstan-ignore-next-line */
$token = env('GH_TOKEN'); // Use the GitHub token from the environment

if (! $token) {
$this->error('GitHub token (GH_TOKEN) not found in environment variables.');

return self::FAILURE;
}

foreach (File::directories(base_path('packages')) as $package) {
$json = json_decode(File::get("{$package}/composer.json"), true);

Expand All @@ -34,8 +25,8 @@ public function handle(): int

$this->info("Splitting package at '{$package}' into repository '{$json['name']}'");

// Construct the repository URL with the token
$repoUrl = "https://{$token}@github.com/{$json['name']}.git";
// Repository URL (no token needed when using actions/checkout)
$repoUrl = "https://github.com/{$json['name']}.git";

// Ensure clean git configuration
Process::run("git config -l | grep 'http\\..*\\.extraheader' | cut -d= -f1 | xargs -L1 git config --unset-all");
Expand Down

0 comments on commit 4aca436

Please sign in to comment.