From 1edfd1cea77f815fc8ad9c126ee38a79207cc3fb Mon Sep 17 00:00:00 2001 From: Felipe Suero Date: Wed, 26 Apr 2023 14:24:29 -0400 Subject: [PATCH 1/4] modify job to run on workflow run --- .github/workflows/pre-prepare.yml | 9 +++++---- .github/workflows/release.yml | 7 ++++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pre-prepare.yml b/.github/workflows/pre-prepare.yml index 0b867aee..4aa4359a 100644 --- a/.github/workflows/pre-prepare.yml +++ b/.github/workflows/pre-prepare.yml @@ -1,14 +1,15 @@ -name: Pre-Prepare +name: Pull langauge server changes on: workflow_dispatch: inputs: - pull-langugageserver: - description: "Are there changes to language server?" - required: true target-branch: description: name of the branch that contains the desired changes required: true + workflow_run: + workflows: ["Create release PR"] + types: + - completed permissions: contents: write diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index feb08423..7a1e0716 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,6 +8,11 @@ on: version: required: true description: "Version to bump `package.json` to (format: x.y.z)" + update-language-server: + required: false + description: "Update the language server to the latest version?" + type: boolean + jobs: create-release-pr: @@ -47,4 +52,4 @@ jobs: --base main \ --head release/${{ inputs.version }} env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From ae1638116eff722bc83cb33a2af4c141ad5215a0 Mon Sep 17 00:00:00 2001 From: Felipe Suero Date: Wed, 26 Apr 2023 14:30:48 -0400 Subject: [PATCH 2/4] oopsie doodle --- .github/workflows/pre-prepare.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-prepare.yml b/.github/workflows/pre-prepare.yml index 4aa4359a..579ea66b 100644 --- a/.github/workflows/pre-prepare.yml +++ b/.github/workflows/pre-prepare.yml @@ -1,4 +1,4 @@ -name: Pull langauge server changes +name: Pull language server changes on: workflow_dispatch: @@ -10,6 +10,15 @@ on: workflows: ["Create release PR"] types: - completed + inputs: + target-branch: + required: true + type: string + description: name of the branch that contains the desired changes + run: + required: true + type: boolean + description: whether or not to run the workflow permissions: contents: write @@ -23,24 +32,31 @@ jobs: with: fetch-depth: 0 ref: ${{github.event.inputs.target-branch}} + if: ${{ github.event.inputs.run == 'true' }}} - name: Setup Node uses: actions/setup-node@v2 with: node-version: 16.x cache: "npm" registry-url: "https://npm.pkg.github.com" + if: ${{ github.event.inputs.run == 'true' }}} - name: run npm install run: npm install @actions/languageserver@latest @actions/workflow-parser@latest --workspaces=false + if: ${{ github.event.inputs.run == 'true' }}} - name: revert changes to package.json run: git checkout -- package.json + if: ${{ github.event.inputs.run == 'true' }}} - name: debugging run: git diff + if: ${{ github.event.inputs.run == 'true' }}} - name: run npm i run: npm i + if: ${{ github.event.inputs.run == 'true' }}} - name: debugging run: git diff + if: ${{ github.event.inputs.run == 'true' }}} - uses: stefanzweifel/git-auto-commit-action@v4 with: branch: ${{github.event.inputs.target-branch}} - + if: ${{ github.event.inputs.run == 'true' }}} From 9e55ea4326841db59a5d49193ffd21e7ffc11207 Mon Sep 17 00:00:00 2001 From: Felipe Suero Date: Wed, 26 Apr 2023 14:49:47 -0400 Subject: [PATCH 3/4] Make pre-prepare run after release --- .github/workflows/pre-prepare.yml | 4 ++++ .github/workflows/release.yml | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pre-prepare.yml b/.github/workflows/pre-prepare.yml index 579ea66b..904e9b38 100644 --- a/.github/workflows/pre-prepare.yml +++ b/.github/workflows/pre-prepare.yml @@ -6,6 +6,10 @@ on: target-branch: description: name of the branch that contains the desired changes required: true + run: + description: whether or not to run the workflow + required: true + type: boolean workflow_run: workflows: ["Create release PR"] types: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7a1e0716..94fb9201 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,4 +52,7 @@ jobs: --base main \ --head release/${{ inputs.version }} env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + outputs: + target-branch: release/${{ github.event.inputs.version }} + run: ${{ github.event.inputs.update-language-server}} \ No newline at end of file From 8f70df7b4f39af5f8a1b5a7df2daaefa6d2c165b Mon Sep 17 00:00:00 2001 From: Felipe Suero Date: Thu, 27 Apr 2023 08:53:43 -0400 Subject: [PATCH 4/4] this should work --- .github/workflows/pre-prepare.yml | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/.github/workflows/pre-prepare.yml b/.github/workflows/pre-prepare.yml index 904e9b38..9339e88a 100644 --- a/.github/workflows/pre-prepare.yml +++ b/.github/workflows/pre-prepare.yml @@ -1,15 +1,6 @@ name: Pull language server changes on: - workflow_dispatch: - inputs: - target-branch: - description: name of the branch that contains the desired changes - required: true - run: - description: whether or not to run the workflow - required: true - type: boolean workflow_run: workflows: ["Create release PR"] types: @@ -35,32 +26,32 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - ref: ${{github.event.inputs.target-branch}} - if: ${{ github.event.inputs.run == 'true' }}} + ref: ${{inputs.target-branch}} + if: ${{inputs.run == 'true' }}} - name: Setup Node uses: actions/setup-node@v2 with: node-version: 16.x cache: "npm" registry-url: "https://npm.pkg.github.com" - if: ${{ github.event.inputs.run == 'true' }}} + if: ${{inputs.run == 'true' }}} - name: run npm install run: npm install @actions/languageserver@latest @actions/workflow-parser@latest --workspaces=false - if: ${{ github.event.inputs.run == 'true' }}} + if: ${{inputs.run == 'true' }}} - name: revert changes to package.json run: git checkout -- package.json - if: ${{ github.event.inputs.run == 'true' }}} + if: ${{inputs.run == 'true' }}} - name: debugging run: git diff - if: ${{ github.event.inputs.run == 'true' }}} + if: ${{inputs.run == 'true' }}} - name: run npm i run: npm i - if: ${{ github.event.inputs.run == 'true' }}} + if: ${{inputs.run == 'true' }}} - name: debugging run: git diff - if: ${{ github.event.inputs.run == 'true' }}} + if: ${{inputs.run == 'true' }}} - uses: stefanzweifel/git-auto-commit-action@v4 with: - branch: ${{github.event.inputs.target-branch}} - if: ${{ github.event.inputs.run == 'true' }}} + branch: ${{inputs.target-branch}} + if: ${{inputs.run == 'true' }}}