Skip to content

Commit 6f8b46d

Browse files
committed
fix: resolve repo rule violations in deploy workflows
Deploy Dev's generate-types job failed because peter-evans/create-pull-request pushed unsigned commits, violating repo rulesets. Added sign-commits: true to use the GitHub API for signed commits, bypassing the restriction. Deploy Prod's generate-types job pushed directly to main via git push, violating branch protection rules requiring PRs and approvals. Replaced with peter-evans/create-pull-request (matching dev's pattern) with sign-commits: true, added pull-requests: write permission, and added a summary step. https://claude.ai/code/session_01Uhx2N3zWZNBTsgMQo7zajM
1 parent cd13ffa commit 6f8b46d

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

.github/workflows/deploy-dev.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ jobs:
8282
This PR updates `packages/db/types/database.ts` to reflect the latest dev schema.
8383
add-paths: packages/db/types/database.ts
8484
delete-branch: true
85+
sign-commits: true
8586

8687
- name: Summary
8788
run: |

.github/workflows/deploy-prod.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ jobs:
124124
runs-on: ubuntu-latest
125125
permissions:
126126
contents: write
127+
pull-requests: write
127128
steps:
128129
- uses: actions/checkout@v4
129130
with:
@@ -146,16 +147,27 @@ jobs:
146147
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
147148
SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_PROD_DB_PASSWORD }}
148149

149-
- name: Commit types if changed
150+
- name: Create PR if types changed
151+
uses: peter-evans/create-pull-request@v7
152+
id: types-pr
153+
with:
154+
branch: chore/regenerate-prod-db-types
155+
commit-message: "chore(db): regenerate prod database types"
156+
title: "chore(db): regenerate prod database types"
157+
body: |
158+
Auto-generated by the **Deploy Prod** workflow after migrations were applied.
159+
160+
This PR updates `packages/db/types/database.ts` to reflect the latest production schema.
161+
add-paths: packages/db/types/database.ts
162+
delete-branch: true
163+
sign-commits: true
164+
165+
- name: Summary
150166
run: |
151-
git config user.name "github-actions[bot]"
152-
git config user.email "github-actions[bot]@users.noreply.github.com"
153-
git add packages/db/types/database.ts
154-
if git diff --cached --quiet; then
155-
echo "No type changes detected"
167+
if [ "${{ steps.types-pr.outputs.pull-request-number }}" ]; then
168+
echo "### Types — PR [#${{ steps.types-pr.outputs.pull-request-number }}](${{ steps.types-pr.outputs.pull-request-url }}) created ✅" >> "$GITHUB_STEP_SUMMARY"
156169
else
157-
git commit -m "chore(db): regenerate prod database types"
158-
git push
170+
echo "### Types — No changes ✅" >> "$GITHUB_STEP_SUMMARY"
159171
fi
160172
161173
# ─── Smoke test: always runs (even if migration was skipped) ──

0 commit comments

Comments
 (0)