forked from stripe/openapi
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (77 loc) · 2.96 KB
/
Copy pathpublish.yml
File metadata and controls
89 lines (77 loc) · 2.96 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Publish
on:
workflow_dispatch: {}
push:
tags:
- v[0-9]+
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
# Fetch this repository
- uses: actions/checkout@v2
# Set up GO
- uses: actions/setup-go@v2
with:
go-version: 1.19
# Fetch app installation token
- uses: tibdex/github-app-token@v1.5.2
id: gh-api-token
with:
app_id: ${{ secrets.GH_APP_STRIPE_OPENAPI_APP_ID }}
private_key: ${{ secrets.GH_APP_STRIPE_OPENAPI_PRIVATE_KEY }}
# Fetch repositories to modify
- uses: actions/checkout@v3
with:
token: ${{ steps.gh-api-token.outputs.token }}
repository: stripe/stripe-mock
path: stripe-mock
- uses: actions/checkout@v3
with:
token: ${{ steps.gh-api-token.outputs.token }}
repository: stripe/stripe-cli
path: stripe-cli
- run: |
rm -f ./api/openapi-spec/spec3.sdk.json
cp ../openapi/spec3.sdk.json ./api/openapi-spec/spec3.sdk.json
go generate ./...
working-directory: ./stripe-cli
- run: |
rm -f ./stripe-mock/openapi/spec3.json
rm -f ./stripe-mock/openapi/fixtures3.json
cp openapi/spec3.json stripe-mock/openapi/spec3.json
cp openapi/fixtures3.json stripe-mock/openapi/fixtures3.json
# Create pull request on stripe-mock
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
path: stripe-mock
title: OpenAPI Update
body: |
Automated OpenAPI update for https://github.com/stripe/openapi/commit/${{ github.sha }}
[→ Debug this workflow](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}})
branch: update-openapi
token: ${{ steps.gh-api-token.outputs.token }}
delete-branch: true
commit-message: Update OpenAPI for ${{ github.sha }}
committer: "Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>"
author: "Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>"
assignees: ${{ github.actor }}
reviewers: ${{ github.actor }}
# Create pull request on openapi
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
path: stripe-cli
title: OpenAPI Update
body: |
Automated OpenAPI update for https://github.com/stripe/openapi/commit/${{ github.sha }}
This pull request was initiated by @${{ github.actor }}
[→ Debug this workflow](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}})
branch: update-openapi
token: ${{ steps.gh-api-token.outputs.token }}
delete-branch: true
commit-message: Update OpenAPI for ${{ github.sha }}
committer: "Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>"
author: "Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>"