-
Notifications
You must be signed in to change notification settings - Fork 484
65 lines (55 loc) · 2.17 KB
/
Copy pathapi-package-sync.yml
File metadata and controls
65 lines (55 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: API Package Sync
on:
schedule:
- cron: "17 * * * *"
workflow_dispatch:
permissions:
contents: read
jobs:
sync:
name: Sync API package
runs-on: blacksmith-8vcpu-ubuntu-2404
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Setup
uses: ./.github/actions/setup
with:
dependency-firewall-token: ${{ secrets.DF_FIREWALL_TOKEN }}
- name: Regenerate API package
run: pnpm generate
working-directory: packages/api
- name: Format API package
run: pnpm exec nx run @supabase/api:fmt:fix
- name: Check for generated changes
id: check
run: |
if git diff --ignore-space-at-eol --exit-code --quiet packages/api/src/generated; then
echo "No generated changes detected."
echo "has_changes=false" >> "$GITHUB_OUTPUT"
else
echo "Generated changes detected."
echo "has_changes=true" >> "$GITHUB_OUTPUT"
fi
- name: Generate token
if: steps.check.outputs.has_changes == 'true'
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.GH_APP_CLIENT_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
permission-pull-requests: write
permission-contents: write
- name: Create Pull Request
if: steps.check.outputs.has_changes == 'true'
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
token: ${{ steps.app-token.outputs.token }}
commit-message: "chore(api): sync Management API OpenAPI spec"
title: "chore(api): sync Management API OpenAPI spec"
body: |
This PR was automatically created to sync the generated `@supabase/api` package with the latest Management API OpenAPI document.
Changes were detected in the upstream OpenAPI document exposed by `https://api.supabase.com/api/v1-json`.
branch: sync/api-package
base: develop