Skip to content

Commit ad43985

Browse files
authoredDec 18, 2024
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. (#46)
* 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. * Fix styling --------- Co-authored-by: thejmitchener <thejmitchener@users.noreply.github.com>
1 parent 29ad4da commit ad43985

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
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-3
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

@@ -61,12 +62,12 @@ public function handle(): bool
6162

6263
$this->info('Sitemap generated successfully.');
6364

64-
return true;
65+
return CommandAlias::SUCCESS;
6566
} catch (Exception $e) {
6667
Log::error('Sitemap generation failed: '.$e->getMessage());
6768
$this->error('Sitemap generation failed: '.$e->getMessage());
6869

69-
return false;
70+
return CommandAlias::FAILURE;
7071
}
7172
}
7273

0 commit comments

Comments
 (0)
Please sign in to comment.