Skip to content

Commit

Permalink
feat: only send emails when a source increases (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
djaiss authored Nov 14, 2019
1 parent 002e1ce commit c92a3a0
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 6 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/laravel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Unit tests

on: [push]

jobs:
phpunit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: Generate key
run: php artisan key:generate
- name: Create database
run: |
mkdir -p database
touch database/database.sqlite
- name: Run migrations
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: php artisan migrate
- name: Execute tests via PHPUnit
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
GITHUB_TOKEN: ${{secrets.GH_TOKEN}}
run: vendor/bin/phpunit
3 changes: 2 additions & 1 deletion app/Mail/SourceChanged.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function __construct(Source $source, string $sentence)
*/
public function build()
{
return $this->markdown('emails.source.changed');
return $this->markdown('emails.source.changed')
->subject($this->source->username.'/'.$this->source->repository.' has grown on Github');
}
}
Binary file modified public/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div align="center">
![egonotifier logo](public/img/logo.png)
**Egonotifier monitors repositories you care about and sends you an email when they reach new milestones.**
</div>

<div align="center">
![egonotifier screenshot](public/img/homepage-2x.png)
</div>
2 changes: 1 addition & 1 deletion resources/views/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="mw7 center ph3-ns mt4">
<div class="cf ph2-ns">
<div class="box bg-white pa3 mb3">
<form method="POST" action="{{ route('login') }}">
<form method="POST" action="{{ route('register') }}">
@csrf

<div class="form-group row mb3">
Expand Down
8 changes: 4 additions & 4 deletions resources/views/emails/source/changed.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
The following repository:

***********
https:/github.com/{{ $source->username }}/{{ $source->repository }}
***********
<a href="https:/github.com/{{ $source->username }}/{{ $source->repository }}">https:/github.com/{{ $source->username }}/{{ $source->repository }}</a>
***********

{{ $sentence }}
{{ $sentence }}

@endcomponent
@endcomponent

0 comments on commit c92a3a0

Please sign in to comment.