Skip to content

Commit 7d9b43c

Browse files
committed
chore(ci): minimal CI job 3
1 parent 9f80c36 commit 7d9b43c

File tree

2 files changed

+23
-31
lines changed

2 files changed

+23
-31
lines changed

.github/workflows/publish.yml

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: Minimal App Token Push & PR Test
1+
name: Minimal App Token Release & PR Test
22

33
on:
44
workflow_dispatch:
55

66
jobs:
7-
push-and-pr-test:
7+
release-stable-pr:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Generate App token
@@ -18,31 +18,21 @@ jobs:
1818
with:
1919
fetch-depth: 0
2020

21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
cache: 'npm'
25+
26+
- name: Install dependencies
27+
run: npm ci --legacy-peer-deps
28+
2129
- name: Configure git user
2230
run: |
2331
git config --global user.name "supabase-releaser[bot]"
2432
git config --global user.email "supabase-releaser[bot]@users.noreply.github.com"
2533
26-
- name: Remove credential helpers and set remote
27-
run: |
28-
git config --global --unset credential.helper || true
29-
git config --local --unset credential.helper || true
30-
git remote set-url origin https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/supabase/supabase-js.git
31-
32-
- name: Create and push branch
33-
run: |
34-
git checkout -b minimal-token-test
35-
touch minimal.txt
36-
git add minimal.txt
37-
git commit -m "test: minimal token branch push"
38-
git push origin minimal-token-test
39-
40-
- name: Create PR with gh CLI
34+
- name: Run release-stable script
4135
env:
36+
RELEASE_GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
4237
GH_TOKEN: ${{ steps.app-token.outputs.token }}
43-
run: |
44-
gh pr create \
45-
--base master \
46-
--head minimal-token-test \
47-
--title "Minimal token push test" \
48-
--body "Automated PR from minimal App token workflow"
38+
run: npm run release-stable

scripts/release-stable.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ import { execSync } from 'child_process'
2424
const authHeader = `AUTHORIZATION: basic ${Buffer.from(`x-access-token:${process.env.RELEASE_GITHUB_TOKEN}`).toString('base64')}`
2525
execSync(`git config --local http.https://github.com/.extraheader "${authHeader}"`)
2626

27-
// [Your code for changelog/tagging or npm publish goes here...]
27+
// ---- RELEASE LOGIC ----
28+
// Insert your release logic here (e.g. changelog, tagging, npm publish, etc.)
29+
// Example:
30+
// execSync('npm run release-build-or-tag-step-here')
2831

2932
// Restore the header (if it existed) and GH token
3033
if (originalAuth) {
@@ -39,9 +42,6 @@ import { execSync } from 'child_process'
3942
process.env.GITHUB_TOKEN = process.env.RELEASE_GITHUB_TOKEN
4043

4144
// Remove ALL credential helpers to ensure only our token is used
42-
try {
43-
execSync('git config --system --unset credential.helper || true')
44-
} catch {}
4545
try {
4646
execSync('git config --global --unset credential.helper || true')
4747
} catch {}
@@ -55,11 +55,12 @@ import { execSync } from 'child_process'
5555
execSync(`git remote set-url origin "${remoteUrl}"`)
5656
}
5757

58-
const branchName = `release-test`
58+
// Use a descriptive branch name for the release
59+
const branchName = `test-pr-create`
5960

6061
try {
6162
execSync(`git checkout -b ${branchName}`)
62-
// create a small file and git add it
63+
// create a small file and git add it (replace with actual release changes)
6364
execSync('touch test.txt')
6465
execSync('git add test.txt')
6566

@@ -74,13 +75,14 @@ import { execSync } from 'child_process'
7475

7576
// Open PR using GitHub CLI (GH_TOKEN is automatically picked up in CI)
7677
execSync(
77-
`gh pr create --base master --head ${branchName} --title "chore(repo): test permissions" --body "chore(repo): test permissions"`,
78+
`gh pr create --base master --head ${branchName} --title "chore(repo): automated release" --body "Automated release PR from script"`,
7879
{ stdio: 'inherit' }
7980
)
8081

81-
// Enable auto-merge
82+
// Enable auto-merge (optional, remove if you want manual review)
8283
execSync(`gh pr merge --auto --squash`, { stdio: 'inherit' })
8384
} catch (err) {
8485
console.error('❌ Failed to push release branch or open PR', err)
86+
process.exit(1)
8587
}
8688
})()

0 commit comments

Comments
 (0)