1- name : Publish releases
2- # Consolidates canary and stable releases into single workflow
3- # Trusted workflow for publishing to npm
1+ name : Minimal App Token Push Test
42
53on :
6- push :
7- branches : [master]
84 workflow_dispatch :
95
10- env :
11- NODE_VERSION : ' 20'
12-
136jobs :
14- release-stable : # stable releases can only be manually triggered
15- if : ${{ github.event_name == 'workflow_dispatch' }}
7+ push-test :
168 runs-on : ubuntu-latest
17- permissions :
18- contents : read
19- id-token : write
20-
219 steps :
22- - name : Generate token
10+ - name : Generate App token
2311 id : app-token
2412 uses : actions/create-github-app-token@v2
2513 with :
@@ -30,114 +18,25 @@ jobs:
3018 with :
3119 fetch-depth : 0
3220
33- - uses : actions/setup-node@v4
34- with :
35- node-version : ${{ env.NODE_VERSION }}
36- cache : ' npm'
37- registry-url : ' https://registry.npmjs.org'
38-
39- # Ensure npm 11.5.1 or later is installed for trusted publishing support
40- - name : Update npm
41- run : npm install -g npm@latest
42-
43- - name : Install dependencies
44- run : npm ci --legacy-peer-deps
45-
46- - name : Configure git
21+ - name : Configure git user
4722 run : |
4823 git config --global user.name "supabase-releaser[bot]"
4924 git config --global user.email "supabase-releaser[bot]@users.noreply.github.com"
5025
51- # Remove ALL git credential helpers to ensure our App token is used
52- - name : Remove Actions credential helper
26+ - name : Remove credential helpers and set remote
5327 run : |
54- git config --system --unset credential.helper || true
5528 git config --global --unset credential.helper || true
5629 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+ echo "Remote:"
32+ git remote -v
33+ echo "Credential helper:"
34+ git config --show-origin --get credential.helper || true
5735
58- - name : Set git remote to use App token
59- run : git remote set-url origin https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/supabase/supabase-js.git
60-
61- # No need to run gh auth login --with-token if GH_TOKEN is set
62- - name : Create and push branch with gh CLI
63- env :
64- GH_TOKEN : ${{ steps.app-token.outputs.token }}
36+ - name : Create and push branch
6537 run : |
66- git checkout --orphan test-token-push
67- git commit --allow-empty -m "chore(repo): test push"
68- git push origin test-token-push
69-
70- - name : Create pull request with gh CLI
71- env :
72- GH_TOKEN : ${{ steps.app-token.outputs.token }}
73- run : |
74- gh pr create \
75- --base master \
76- --head test-token-push \
77- --title "chore(repo): test push" \
78- --body "Automated PR for test-token-push"
79-
80- - name : Release
81- env :
82- NPM_CONFIG_PROVENANCE : true
83- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
84- RELEASE_GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
85- run : |
86- npm run release-stable
87-
88- trigger-update-js-libs :
89- name : Trigger Update JS Libs
90- runs-on : ubuntu-latest
91- needs : release-stable
92- if : ${{ github.event_name == 'workflow_dispatch' && needs.release-stable.result == 'success' }}
93- steps :
94- - name : Generate token
95- id : app-token
96- uses : actions/create-github-app-token@v2
97- with :
98- app-id : ${{ secrets.APP_ID }}
99- private-key : ${{ secrets.PRIVATE_KEY }}
100- - name : Trigger supabase/supabase update-js-libs workflow
101- uses : actions/github-script@v7
102- with :
103- github-token : ${{ steps.app-token.outputs.token }}
104- script : |
105- await github.rest.actions.createWorkflowDispatch({
106- owner: 'supabase',
107- repo: 'supabase',
108- workflow_id: 'update-js-libs.yml',
109- ref: 'master',
110- inputs: {
111- version: '2.74.0',
112- source: 'supabase-js-stable-release'
113- }
114- });
115-
116- trigger-supabase-docs-update :
117- name : Trigger Supabase Docs Update
118- runs-on : ubuntu-latest
119- needs : [release-stable]
120- if : ${{ github.event_name == 'workflow_dispatch' && needs.release-stable.result == 'success' }}
121- steps :
122- - name : Generate token
123- id : app-token
124- uses : actions/create-github-app-token@v2
125- with :
126- app-id : ${{ secrets.APP_ID }}
127- private-key : ${{ secrets.PRIVATE_KEY }}
128-
129- - name : Trigger supabase/supabase docs workflow
130- uses : actions/github-script@v7
131- with :
132- github-token : ${{ steps.app-token.outputs.token }}
133- script : |
134- await github.rest.actions.createWorkflowDispatch({
135- owner: 'supabase',
136- repo: 'supabase',
137- workflow_id: 'docs-js-libs-update.yml',
138- ref: 'master',
139- inputs: {
140- version: '2.74.0',
141- source: 'supabase-js-stable-release'
142- }
143- });
38+ git checkout -b minimal-token-test
39+ touch minimal.txt
40+ git add minimal.txt
41+ git commit -m "test: minimal token branch push"
42+ git push origin minimal-token-test
0 commit comments