Skip to content

Commit 1c20353

Browse files
committed
fix: use PR instead of direct push for dev type generation
The deploy-dev workflow fails because `dev` branch has protection rules requiring PRs and status checks. Replace direct `git push` with `peter-evans/create-pull-request` action to create a PR for type changes. https://claude.ai/code/session_01YUW2BPCdUWznL5AiMGSRKm
1 parent 90d7f00 commit 1c20353

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

.github/workflows/deploy-dev.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
runs-on: ubuntu-latest
4747
permissions:
4848
contents: write
49+
pull-requests: write
4950
steps:
5051
- uses: actions/checkout@v4
5152
with:
@@ -68,18 +69,26 @@ jobs:
6869
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
6970
SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_DEV_DB_PASSWORD }}
7071

71-
- name: Commit types if changed
72+
- name: Create PR if types changed
73+
uses: peter-evans/create-pull-request@v7
74+
id: types-pr
75+
with:
76+
branch: chore/regenerate-db-types
77+
commit-message: "chore(db): regenerate database types"
78+
title: "chore(db): regenerate database types"
79+
body: |
80+
Auto-generated by the **Deploy Dev** workflow after migrations were applied.
81+
82+
This PR updates `packages/db/types/database.ts` to reflect the latest dev schema.
83+
add-paths: packages/db/types/database.ts
84+
delete-branch: true
85+
86+
- name: Summary
7287
run: |
73-
git config user.name "github-actions[bot]"
74-
git config user.email "github-actions[bot]@users.noreply.github.com"
75-
git add packages/db/types/database.ts
76-
if git diff --cached --quiet; then
77-
echo "No type changes detected"
78-
echo "### Types — No changes ✅" >> "$GITHUB_STEP_SUMMARY"
88+
if [ "${{ steps.types-pr.outputs.pull-request-number }}" ]; then
89+
echo "### Types — PR [#${{ steps.types-pr.outputs.pull-request-number }}](${{ steps.types-pr.outputs.pull-request-url }}) created ✅" >> "$GITHUB_STEP_SUMMARY"
7990
else
80-
git commit -m "chore(db): regenerate database types"
81-
git push
82-
echo "### Types — Updated and committed ✅" >> "$GITHUB_STEP_SUMMARY"
91+
echo "### Types — No changes ✅" >> "$GITHUB_STEP_SUMMARY"
8392
fi
8493
8594
summary:

0 commit comments

Comments
 (0)