1
1
name : ' Update docs'
2
2
3
3
on :
4
- repository_dispatch :
5
- types : [doc_changes]
6
4
workflow_dispatch :
7
5
inputs :
8
- sha :
6
+ version :
9
7
type : string
10
- description : The SHA of the `electron/electron` commit
8
+ description : The version of the latest Electron release
11
9
required : true
12
10
13
11
concurrency : update-docs
14
12
15
13
permissions : {}
16
14
17
15
jobs :
16
+ get-latest-stable :
17
+ runs-on : ubuntu-latest
18
+ outputs :
19
+ major : ${{ steps.latest-stable-major.outputs.major }}
20
+ steps :
21
+ - run : npm install @electron/fiddle-core
22
+ - name : Get Latest Stable Major
23
+ id : latest-stable-major
24
+ uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
25
+ with :
26
+ script : |
27
+ const { ElectronVersions } = await import('${{ github.workspace }}/node_modules/@electron/fiddle-core/dist/index.js');
28
+
29
+ const { latestStable } = await ElectronVersions.create(undefined, { ignoreCache: true });
30
+ core.setOutput('major', latestStable.major);
18
31
update-docs :
19
32
runs-on : ubuntu-latest
20
33
environment : docs-updater
34
+ needs : get-latest-stable
35
+ if : ${{ startsWith(github.event.inputs.version, format('v{0}', needs.get-latest-stable.outputs.major)) }}
21
36
steps :
22
37
- name : Generate GitHub App token
23
38
uses : electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
@@ -34,10 +49,10 @@ jobs:
34
49
uses : bahmutov/npm-install@ec9e87262db2a1be2ca3ceb2d506c413a220542c # tag: v1.10.5
35
50
- name : Prebuild
36
51
run : |
37
- yarn pre-build ${{ github.event.client_payload.sha || github.event. inputs.sha }}
52
+ yarn pre-build ${{ github.event.inputs.version }}
38
53
git add .
39
- - name : Push changes
40
- uses : dsanders11/github-app-commit-action@43de6da2f4d927e997c0784c7a0b61bd19ad6aac # v1.5.0
41
- with :
42
- message : ' chore: update ref to docs (🤖)'
43
- token : ${{ steps.generate-token.outputs.token }}
54
+ # - name: Push changes
55
+ # uses: dsanders11/github-app-commit-action@43de6da2f4d927e997c0784c7a0b61bd19ad6aac # v1.5.0
56
+ # with:
57
+ # message: 'chore: update ref to docs (🤖)'
58
+ # token: ${{ steps.generate-token.outputs.token }}
0 commit comments