Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Github workflow #31

Merged
merged 2 commits into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/backend.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Deploy the AWS Lambdas

on:
push:
pull_request:
branches:
- 'live'
paths:
Expand All @@ -15,12 +15,12 @@ jobs:
id-token: write
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
go-version: 1.21.x

- name: Build subscribe function
working-directory: backend
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/frontend.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Deploy the Ghost theme

on:
push:
pull_request:
branches:
- 'live'
paths:
Expand All @@ -15,7 +15,7 @@ jobs:
id-token: write
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install dependencies
working-directory: frontend
Expand Down
5 changes: 1 addition & 4 deletions backend/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,9 @@ func processBroadcastRequest(ctx context.Context, body string) (int, string) {
return http.StatusBadRequest, err.Error()
}

// 1. To prevent sending notification for drafts, confirm this post is published.
// 2. To prevent sending emails for unpublished and republished posts, ensure
// that the diff b/w publication and updated dates is not more than 30 minutes.
if !reqData.canBroadcast() {
return http.StatusBadRequest, fmt.Sprintf(
"this post is too old to be rescheduled. It was created at %v and updated at %v ",
"this post is too old to be scheduled. It was created at %v and updated at %v ",
reqData.Post.Current.PublishedAt,
reqData.Post.Current.UpdatedAt,
)
Expand Down
Loading