1
1
name : Follow Up
2
2
3
- on : workflow_dispatch
4
-
3
+ on :
4
+ workflow_dispatch :
5
+ inputs :
6
+ run-id :
7
+ description : docs page GHA run id
8
+ required : true
9
+ type : string
5
10
jobs :
6
11
follow-up :
7
12
runs-on : ubuntu-latest
8
13
steps :
9
- - uses : actions/checkout@v2
10
- - uses : actions/checkout@v2
14
+ - uses : actions/checkout@v4
15
+ - uses : actions/download-artifact@v4
11
16
with :
12
- repository : solvedac/unofficial-documentation
17
+ name : github-pages
13
18
path : unofficial-documentation
14
- - uses : actions/setup-java@v2
19
+ repository : solvedac/unofficial-documentation
20
+ github-token : ${{ secrets.PAT_FOLLOW_UP }}
21
+ run-id : ${{ github.event.inputs.run-id }}
22
+ - run : tar -xf artifact.tar ./tsp-output/@typespec/openapi3/openapi.yaml
23
+ working-directory : unofficial-documentation
24
+ - run : ls -R
25
+ - uses : actions/setup-java@v4
15
26
with :
16
- distribution : adopt
17
- java-version : 11
18
- - uses : actions/setup-node@v2
27
+ distribution : temurin
28
+ java-version : 21
29
+ - uses : actions/setup-node@v4
19
30
- name : Install Dependencies
20
31
run : npm install
21
- - name : Override OpenAPI Version to 3.0.x (generator does not support 3.1)
22
- run : |
23
- for file in `find unofficial-documentation/src -type f`; do
24
- sed -i 's/openapi: "3.1.0"/openapi: "3.0.0"/' $file
25
- done
26
32
- name : Generate
27
- run : npm run generate
33
+ run : npx @openapitools/openapi-generator-cli batch --clean typescript-fetch.yaml
28
34
- name : Tricky TSC Safety
29
35
run : |
30
36
sed -i 's/fetchApi(): FetchAPI/fetchApi(): FetchAPI | undefined/' src/runtime.ts
@@ -40,18 +46,20 @@ jobs:
40
46
run : npm run build
41
47
- name : Update Version
42
48
run : |
43
- sed -ri "s/\"version\": \"[^\"]+\"/\"version\": \"`sed -rn 's/^.* version: "([^"]+)".*$/\1/p' unofficial-documentation/src/openapi.yaml`\"/" package.json
49
+ file=unofficial-documentation/tsp-output/@typespec/openapi3/openapi.yaml
50
+ version=$(sed -rn 's/\s+version:\s*"([^"]+)"/\1/p' $file | sed -rn 's/\.0+([0-9]+)/.\1/p')
51
+ sed -ri "s/\"version\": \"[^\"]+\"/\"version\": \"$version\"/" package.json
44
52
- name : Make Deno Friendly
45
53
run : |
46
54
for file in `find src -type f -name "index.ts"`; do
47
55
cp $file `echo $file | sed s/index/mod/`
48
56
done
49
57
- name : Create Pull Request
50
- uses : peter-evans/create-pull-request@v3
58
+ uses : peter-evans/create-pull-request@v6
51
59
with :
52
60
commit-message : Follow-up solvedac/unofficial-documentation
53
61
title : Follow-up solvedac/unofficial-documentation
54
62
body : |
55
- This Pull Request will update the typescript sources.
63
+ This Pull Request will update the sources based on upstream docs .
56
64
It is automatically created by GitHub Actions.
57
65
labels : follow-up
0 commit comments