Skip to content

Commit d3b685a

Browse files
committed
Refactored the GitHub workflow to run only if the actor is not Dependabot. Updated the return type of the method in the class to use the constants for success and failure.
1 parent 29ad4da commit d3b685a

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.github/workflows/open-ai-pr-description.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
openai-pr-description:
1616
runs-on: ubuntu-22.04
1717
# Run the job only if the actor is NOT Dependabot
18-
if: ${{ !startsWith(github.actor, 'dependabot') }
18+
if: ${{ !startsWith(github.actor, 'dependabot') }}
1919
steps:
2020
- uses: platisd/openai-pr-description@master
2121
with:

src/Commands/SitemapGenerateCommand.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Spatie\Sitemap\SitemapGenerator;
1616
use Spatie\Sitemap\SitemapIndex;
1717
use Spatie\Sitemap\Tags\Url;
18+
use Symfony\Component\Console\Command\Command as CommandAlias;
1819

1920
class SitemapGenerateCommand extends Command
2021
{
@@ -33,7 +34,7 @@ class SitemapGenerateCommand extends Command
3334
* and posts and then either create a sitemap index to include them or
3435
* directly generate a single sitemap.
3536
*/
36-
public function handle(): bool
37+
public function handle(): int
3738
{
3839
$this->diskName = $this->getDiskName();
3940

@@ -60,13 +61,11 @@ public function handle(): bool
6061
}
6162

6263
$this->info('Sitemap generated successfully.');
63-
64-
return true;
64+
return CommandAlias::SUCCESS;
6565
} catch (Exception $e) {
6666
Log::error('Sitemap generation failed: '.$e->getMessage());
6767
$this->error('Sitemap generation failed: '.$e->getMessage());
68-
69-
return false;
68+
return CommandAlias::FAILURE;
7069
}
7170
}
7271

0 commit comments

Comments
 (0)