|
1 | | -name: Build SDKs for pull request |
| 1 | +name: Stainless SDK Builds |
| 2 | + |
| 3 | +run-name: Build Stainless SDKs |
2 | 4 |
|
3 | 5 | on: |
4 | | - repository_dispatch: |
5 | | - types: [stainless-build-trigger] |
| 6 | + # Triggered by the pre-commit workflow after it successfully completes. |
| 7 | + # This ensures the OpenAPI spec file is generated before attempting to build SDKs. |
| 8 | + workflow_dispatch: |
| 9 | + inputs: |
| 10 | + pr_number: |
| 11 | + description: 'Pull request number' |
| 12 | + required: true |
| 13 | + type: string |
| 14 | + pr_action: |
| 15 | + description: 'Pull request action' |
| 16 | + required: true |
| 17 | + type: string |
6 | 18 | pull_request: |
7 | 19 | types: |
8 | 20 | - closed |
9 | 21 |
|
10 | 22 | concurrency: |
11 | | - group: ${{ github.workflow }}-${{ github.event.client_payload.pr_number || github.event.pull_request.number }} |
| 23 | + group: ${{ github.workflow }}-${{ inputs.pr_number || github.event.pull_request.number }} |
12 | 24 | cancel-in-progress: true |
13 | 25 |
|
14 | 26 | env: |
|
31 | 43 |
|
32 | 44 | jobs: |
33 | 45 | preview: |
34 | | - if: github.event_name == 'repository_dispatch' && github.event.client_payload.pr_action != 'closed' |
| 46 | + if: github.event_name == 'workflow_dispatch' && inputs.pr_action != 'closed' |
35 | 47 | runs-on: ubuntu-latest |
36 | 48 | permissions: |
37 | 49 | contents: read |
38 | 50 | pull-requests: write |
39 | 51 | steps: |
40 | 52 | - name: Checkout repository |
41 | | - uses: actions/checkout@v4 |
| 53 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
42 | 54 | with: |
43 | 55 | fetch-depth: 2 |
44 | 56 |
|
45 | 57 | - name: Run preview builds |
46 | | - uses: stainless-api/upload-openapi-spec-action/preview@v1 |
| 58 | + uses: stainless-api/upload-openapi-spec-action/preview@b741c27bc604e5c130b92ed4056b07aee783aa04 # v1.5.4 |
47 | 59 | with: |
48 | 60 | stainless_api_key: ${{ secrets.STAINLESS_API_KEY }} |
49 | 61 | org: ${{ env.STAINLESS_ORG }} |
|
60 | 72 | pull-requests: write |
61 | 73 | steps: |
62 | 74 | - name: Checkout repository |
63 | | - uses: actions/checkout@v4 |
| 75 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
64 | 76 | with: |
65 | 77 | fetch-depth: 2 |
66 | 78 |
|
|
71 | 83 | # against preview/${{ github.head_ref }} to complete, but assuming that |
72 | 84 | # the preview-sdk job happens before the PR merge, it should be fine. |
73 | 85 | - name: Run merge build |
74 | | - uses: stainless-api/upload-openapi-spec-action/merge@v1 |
| 86 | + uses: stainless-api/upload-openapi-spec-action/merge@b741c27bc604e5c130b92ed4056b07aee783aa04 # v1.5.4 |
75 | 87 | with: |
76 | 88 | stainless_api_key: ${{ secrets.STAINLESS_API_KEY }} |
77 | 89 | org: ${{ env.STAINLESS_ORG }} |
|
0 commit comments