Skip to content
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
33 changes: 16 additions & 17 deletions .github/workflows/regenerate-db-types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,13 @@ jobs:
echo "Installing project dependencies"
npm ci --legacy-peer-deps

echo "Installing kysely-codegen globally"
npm install -g kysely-codegen

echo "Verifying kysely-codegen installation"
kysely-codegen --version || {
echo "Error: kysely-codegen installation failed"
exit 1
}
echo "Installing kysely-codegen, typescript, and pg globally"
npm install -g kysely-codegen typescript pg

echo "Verifying installations"
which kysely-codegen || { echo "Error: kysely-codegen not found"; exit 1; }
tsc --version || { echo "Error: typescript not found"; exit 1; }
node -e "require('pg')" || { echo "Error: pg not found"; exit 1; }

- name: Setup PostgreSQL
uses: ikalnytskyi/action-setup-postgres@v6
Expand Down Expand Up @@ -196,14 +195,14 @@ jobs:
if: steps.git-check.outputs.changes == 'true'
id: pr-author
run: |
# username
PR_AUTHOR_NAME="${{ github.event.pull_request.user.login }}"
PR_AUTHOR_EMAIL="${{ github.event.pull_request.user.login }}@users.noreply.github.com"
PR_AUTHOR_EMAIL="${PR_AUTHOR_NAME}@users.noreply.github.com"

REAL_EMAIL=$(gh api /users/${{ github.event.pull_request.user.login }} --jq '.email' 2>/dev/null || echo "")

if [ -n "$REAL_EMAIL" ] && [ "$REAL_EMAIL" != "null" ]; then
PR_AUTHOR_EMAIL="$REAL_EMAIL"
if [ -n "$PR_AUTHOR_NAME" ]; then
REAL_EMAIL=$(gh api /users/${PR_AUTHOR_NAME} --jq '.email' 2>/dev/null || echo "")
if [ -n "$REAL_EMAIL" ] && [ "$REAL_EMAIL" != "null" ]; then
PR_AUTHOR_EMAIL="$REAL_EMAIL"
fi
fi

echo "name=$PR_AUTHOR_NAME" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -231,12 +230,12 @@ jobs:

git commit -m "$COMMIT_MESSAGE"

git push origin HEAD:${{ github.head_ref }}
git push origin HEAD:${{ github.head_ref || github.ref_name }}

echo "Changes committed + pushed successfully"

- name: Comment on PR
if: steps.git-check.outputs.changes == 'true'
if: steps.git-check.outputs.changes == 'true' && github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
Expand All @@ -256,7 +255,7 @@ jobs:
});

- name: Comment on PR if no changes
if: steps.git-check.outputs.changes != 'true'
if: steps.git-check.outputs.changes != 'true' && github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
Expand Down
2 changes: 1 addition & 1 deletion shared/types/db-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ export interface BranchProjectMemberships {
export interface BranchProjects {
created_at: Generated<Timestamp | null>;
currency: Generated<string | null>;
end_date: Timestamp | null;
description: string;
end_date: Timestamp | null;
name: string;
project_id: Generated<number>;
start_date: Timestamp | null;
Expand Down
Loading