Skip to content

Commit e29f0e1

Browse files
authored
fix: use app token for private repo access, drop repository_dispatch (#2)
1 parent ec8e843 commit e29f0e1

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

.github/workflows/regenerate.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Regenerate Client
22

33
on:
4-
repository_dispatch:
5-
types: [openapi-updated]
64
workflow_dispatch:
75

86
jobs:
@@ -11,9 +9,22 @@ jobs:
119
steps:
1210
- uses: actions/checkout@v4
1311

12+
- name: Generate GitHub App token
13+
id: app-token
14+
uses: actions/create-github-app-token@v2
15+
with:
16+
app-id: 3060111
17+
private-key: ${{ secrets.HOTDATA_AUTOMATION_PRIVATE_KEY }}
18+
owner: hotdata-dev
19+
1420
- name: Fetch merged OpenAPI spec
21+
env:
22+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
1523
run: |
16-
curl -sL https://raw.githubusercontent.com/hotdata-dev/www.hotdata.dev/main/api/openapi.yaml \
24+
curl -sS -f -L \
25+
-H "Accept: application/vnd.github.v3.raw" \
26+
-H "Authorization: Bearer $GH_TOKEN" \
27+
https://api.github.com/repos/hotdata-dev/www.hotdata.dev/contents/api/openapi.yaml \
1728
-o openapi.yaml
1829
1930
- name: Clean existing source

0 commit comments

Comments
 (0)