Skip to content

Commit c59f9f6

Browse files
authored
Merge pull request #146 from github/automation-v1
Make pre-prepare run off of hooks
2 parents de41c0e + 8f70df7 commit c59f9f6

2 files changed

Lines changed: 32 additions & 12 deletions

File tree

.github/workflows/pre-prepare.yml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
name: Pre-Prepare
1+
name: Pull language server changes
22

33
on:
4-
workflow_dispatch:
5-
inputs:
6-
pull-langugageserver:
7-
description: "Are there changes to language server?"
8-
required: true
9-
target-branch:
10-
description: name of the branch that contains the desired changes
11-
required: true
4+
workflow_run:
5+
workflows: ["Create release PR"]
6+
types:
7+
- completed
8+
inputs:
9+
target-branch:
10+
required: true
11+
type: string
12+
description: name of the branch that contains the desired changes
13+
run:
14+
required: true
15+
type: boolean
16+
description: whether or not to run the workflow
1217

1318
permissions:
1419
contents: write
@@ -21,25 +26,32 @@ jobs:
2126
uses: actions/checkout@v2
2227
with:
2328
fetch-depth: 0
24-
ref: ${{github.event.inputs.target-branch}}
29+
ref: ${{inputs.target-branch}}
30+
if: ${{inputs.run == 'true' }}}
2531
- name: Setup Node
2632
uses: actions/setup-node@v2
2733
with:
2834
node-version: 16.x
2935
cache: "npm"
3036
registry-url: "https://npm.pkg.github.com"
37+
if: ${{inputs.run == 'true' }}}
3138
- name: run npm install
3239
run: npm install @actions/languageserver@latest @actions/workflow-parser@latest --workspaces=false
40+
if: ${{inputs.run == 'true' }}}
3341
- name: revert changes to package.json
3442
run: git checkout -- package.json
43+
if: ${{inputs.run == 'true' }}}
3544
- name: debugging
3645
run: git diff
46+
if: ${{inputs.run == 'true' }}}
3747
- name: run npm i
3848
run: npm i
49+
if: ${{inputs.run == 'true' }}}
3950
- name: debugging
4051
run: git diff
52+
if: ${{inputs.run == 'true' }}}
4153
- uses: stefanzweifel/git-auto-commit-action@v4
4254
with:
43-
branch: ${{github.event.inputs.target-branch}}
44-
55+
branch: ${{inputs.target-branch}}
56+
if: ${{inputs.run == 'true' }}}
4557

.github/workflows/release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ on:
88
version:
99
required: true
1010
description: "Version to bump `package.json` to (format: x.y.z)"
11+
update-language-server:
12+
required: false
13+
description: "Update the language server to the latest version?"
14+
type: boolean
15+
1116

1217
jobs:
1318
create-release-pr:
@@ -48,3 +53,6 @@ jobs:
4853
--head release/${{ inputs.version }}
4954
env:
5055
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
outputs:
57+
target-branch: release/${{ github.event.inputs.version }}
58+
run: ${{ github.event.inputs.update-language-server}}

0 commit comments

Comments
 (0)