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
11 changes: 9 additions & 2 deletions .github/workflows/api-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,19 @@ jobs:
echo "has_changes=true" >> $GITHUB_OUTPUT
fi

- name: Generate token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}

- name: Create Pull Request
if: steps.check.outputs.has_changes == 'true'
id: cpr
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GH_PAT }}
token: ${{ steps.app-token.outputs.token }}
commit-message: "chore: sync API types from infrastructure"
title: "chore: sync API types from infrastructure"
body: |
Expand All @@ -58,4 +65,4 @@ jobs:
if: steps.check.outputs.has_changes == 'true'
run: gh pr merge --auto --squash "${{ steps.cpr.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
10 changes: 8 additions & 2 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,23 @@ jobs:
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Generate token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
# Here the PR gets approved.
- name: Approve a PR
if: ${{ steps.meta.outputs.update-type == 'version-update:semver-patch' || (!startsWith(steps.meta.outputs.previous-version, '0.') && steps.meta.outputs.update-type == 'version-update:semver-minor') }}
run: gh pr review --approve "${{ github.event.pull_request.html_url }}"
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

# Finally, this sets the PR to allow auto-merging for patch and minor
# updates if all checks pass
- name: Enable auto-merge for Dependabot PRs
if: ${{ steps.meta.outputs.update-type == 'version-update:semver-patch' || (!startsWith(steps.meta.outputs.previous-version, '0.') && steps.meta.outputs.update-type == 'version-update:semver-minor') }}
run: gh pr merge --auto --squash "${{ github.event.pull_request.html_url }}"
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
17 changes: 14 additions & 3 deletions .github/workflows/release-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

permissions:
contents: write
id-token: write

jobs:
release:
Expand Down Expand Up @@ -65,14 +66,21 @@ jobs:
if: needs.release.outputs.new-release-published == 'true'
runs-on: ubuntu-latest
steps:
# use GitHub app to create a release token that can publish to homebrew-tap and scoop
- name: Generate token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- run: go run tools/publish/main.go --beta "${{ needs.release.outputs.new-release-version }}"
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

publish:
name: Publish NPM
Expand All @@ -87,7 +95,10 @@ jobs:
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"

# Ensure npm 11.5.1 or later is installed for trusted publishing support
- name: Update npm
run: npm install -g npm@latest

- run: npm --git-tag-version=false version ${{ needs.release.outputs.new-release-version }}
- run: npm publish --tag ${{ needs.release.outputs.new-release-channel }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
34 changes: 30 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
permissions:
contents: write
packages: write
id-token: write

jobs:
settings:
Expand All @@ -31,14 +32,21 @@ jobs:
- settings
runs-on: ubuntu-latest
steps:
# use GitHub app to create a release token that can publish to homebrew-tap and scoop
- name: Generate token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- run: go run tools/publish/main.go ${{ needs.settings.outputs.release_tag }}
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

publish:
name: Publish NPM
Expand All @@ -53,14 +61,20 @@ jobs:
name: Bump self-hosted versions
runs-on: ubuntu-latest
steps:
- name: Generate token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- run: go run tools/selfhost/main.go
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

changelog:
name: Publish changelog
Expand All @@ -69,14 +83,20 @@ jobs:
- publish
runs-on: ubuntu-latest
steps:
- name: Generate token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- run: go run tools/changelog/main.go ${{ secrets.SLACK_CHANNEL }}
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}

docs:
Expand All @@ -85,11 +105,17 @@ jobs:
- settings
runs-on: ubuntu-latest
steps:
- name: Generate token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- run: go run docs/main.go ${{ needs.settings.outputs.release_tag }} | go run tools/bumpdoc/main.go apps/docs/spec/cli_v1_commands.yaml
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
7 changes: 6 additions & 1 deletion .github/workflows/tag-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:

permissions:
contents: read
id-token: write

jobs:
tag:
Expand All @@ -26,7 +27,11 @@ jobs:
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"

# Ensure npm 11.5.1 or later is installed for trusted publishing support
- name: Update npm
run: npm install -g npm@latest

- run: npm dist-tag add "supabase@${RELEASE_TAG#v}" latest
env:
RELEASE_TAG: ${{ inputs.release }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious where is trusted publisher configured?

Copy link
Member Author

@staaldraad staaldraad Nov 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is configured in npmjs.com - busy setting it up with copple now (edit: configuration done)

Loading