Skip to content

Commit a4c727f

Browse files
committed
use ssh, fix path
1 parent 1836db8 commit a4c727f

File tree

2 files changed

+32
-22
lines changed

2 files changed

+32
-22
lines changed

.github/workflows/sdk_generation.yaml

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,42 @@ permissions:
1818
schedule:
1919
- cron: 0 0 * * *
2020
jobs:
21-
fetch_openapi:
21+
generate:
2222
runs-on: ubuntu-latest
2323
steps:
24-
- name: Checkout SDK repo
25-
uses: actions/checkout@v3
26-
2724
- name: Checkout developers repo
2825
uses: actions/checkout@v3
29-
with:
30-
repository: firehydrant/developers
31-
path: 'dev-repo'
32-
token: ${{ secrets.CROSS_REPO_TOKEN }}
26+
27+
- name: Set up SSH
28+
env:
29+
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
30+
run: |
31+
mkdir -p ~/.ssh
32+
ssh-keyscan github.com >> ~/.ssh/known_hosts
33+
echo "${{ secrets.FH_OPS_SSH_KEY }}" > ~/.ssh/id_ed25519
34+
chmod 600 ~/.ssh/id_ed25519
35+
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
36+
ssh-add ~/.ssh/id_ed25519
37+
38+
- name: Clone developers repo
39+
env:
40+
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
41+
run: |
42+
git clone [email protected]:firehydrant/developers.git dev-repo
43+
cd dev-repo
44+
git checkout main
3345
3446
- name: Copy OpenAPI spec
3547
run: |
3648
mkdir -p .speakeasy
37-
cp dev-repo/docs/public/openapi3_doc.json .speakeasy/openapi.json
38-
39-
generate:
40-
needs: fetch_openapi
41-
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
42-
with:
43-
force: ${{ github.event.inputs.force }}
44-
mode: pr
45-
set_version: ${{ github.event.inputs.set_version }}
46-
secrets:
47-
github_access_token: ${{ secrets.CROSS_REPO_TOKEN }}
48-
npm_token: ${{ secrets.NPM_TOKEN }}
49-
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
49+
cp dev-repo/docs/public/openapi3_doc.json ${GITHUB_WORKSPACE}/openapi.json
50+
51+
- name: Generate SDK
52+
uses: speakeasy-api/sdk-generation-action@v15
53+
with:
54+
force: ${{ github.event.inputs.force }}
55+
mode: pr
56+
set_version: ${{ github.event.inputs.set_version }}
57+
github_access_token: ${{ secrets.CROSS_REPO_TOKEN }}
58+
npm_token: ${{ secrets.NPM_TOKEN }}
59+
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}

.speakeasy/workflow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ speakeasyVersion: latest
33
sources:
44
firehydrant-oas:
55
inputs:
6-
- location: ./.speakeasy/openapi.json
6+
- location: ${GITHUB_WORKSPACE}/openapi.json
77
registry:
88
location: registry.speakeasyapi.dev/firehydrant/firehydrant/firehydrant-oas
99
targets:

0 commit comments

Comments
 (0)