Skip to content

Commit

Permalink
Refactored the GitHub workflow to run only if the actor is not Depend…
Browse files Browse the repository at this point in the history
…abot. 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 <[email protected]>
  • Loading branch information
thejmitchener and thejmitchener authored Dec 18, 2024
1 parent 29ad4da commit ad43985
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/open-ai-pr-description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
openai-pr-description:
runs-on: ubuntu-22.04
# Run the job only if the actor is NOT Dependabot
if: ${{ !startsWith(github.actor, 'dependabot') }
if: ${{ !startsWith(github.actor, 'dependabot') }}
steps:
- uses: platisd/openai-pr-description@master
with:
Expand Down
7 changes: 4 additions & 3 deletions src/Commands/SitemapGenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Spatie\Sitemap\SitemapGenerator;
use Spatie\Sitemap\SitemapIndex;
use Spatie\Sitemap\Tags\Url;
use Symfony\Component\Console\Command\Command as CommandAlias;

class SitemapGenerateCommand extends Command
{
Expand All @@ -33,7 +34,7 @@ class SitemapGenerateCommand extends Command
* and posts and then either create a sitemap index to include them or
* directly generate a single sitemap.
*/
public function handle(): bool
public function handle(): int
{
$this->diskName = $this->getDiskName();

Expand Down Expand Up @@ -61,12 +62,12 @@ public function handle(): bool

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

return true;
return CommandAlias::SUCCESS;
} catch (Exception $e) {
Log::error('Sitemap generation failed: '.$e->getMessage());
$this->error('Sitemap generation failed: '.$e->getMessage());

return false;
return CommandAlias::FAILURE;
}
}

Expand Down

0 comments on commit ad43985

Please sign in to comment.