-
Notifications
You must be signed in to change notification settings - Fork 2
47 lines (42 loc) · 1.39 KB
/
sync_openapi.yml
File metadata and controls
47 lines (42 loc) · 1.39 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
name: Sync OpenAPI
on:
workflow_call:
inputs:
project-name:
required: true
type: string
secrets:
API_TOKEN_GITHUB:
required: true
jobs:
sync:
runs-on: ubuntu-22.04
steps:
- name: Add Github Key
run: |
export GO111MODULE=on
export GOPRIVATE=github.com/IceWhaleTech
git config --global url."https://${{ secrets.API_TOKEN_GITHUB }}@github.com".insteadOf "https://github.com"
- name: Checkout
uses: actions/checkout@v3
with:
path: code
- name: Checkout OpenAPI repo
uses: actions/checkout@v3
with:
repository: IceWhaleTech/IceWhale-OpenAPI
path: openapi
- name: Sync OpenAPI
run: |
rm -rf openapi/${{ inputs.project-name }}
cp -r code/api openapi/${{ inputs.project-name }}
- name: Commit and push changes
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source-directory: './openapi/${{ inputs.project-name }}'
destination-github-username: 'IceWhaleTech'
destination-repository-name: 'IceWhale-OpenAPI'
user-email: q2676515970@163.com
target-directory: './${{ inputs.project-name }}'