Skip to content

Commit ae2c89f

Browse files
authored
ci: update workflows for nodejs projects (#263)
1 parent a6019df commit ae2c89f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/if-nodejs-pr-testing.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,29 @@ jobs:
3636
)
3737
id: should_run
3838
name: Should Run
39-
run: echo "::set-output name=shouldrun::true"
39+
run: echo "shouldrun=true" >> $GITHUB_OUTPUT
4040
- if: steps.should_run.outputs.shouldrun == 'true'
4141
name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows
4242
run: |
4343
git config --global core.autocrlf false
4444
git config --global core.eol lf
4545
- if: steps.should_run.outputs.shouldrun == 'true'
4646
name: Checkout repository
47-
uses: actions/checkout@v2
47+
uses: actions/checkout@v3
4848
- if: steps.should_run.outputs.shouldrun == 'true'
4949
name: Check if Node.js project and has package.json
5050
id: packagejson
51-
run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
51+
run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT
5252
shell: bash
53+
- if: steps.packagejson.outputs.exists == 'true'
54+
name: Check package-lock version
55+
uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master
56+
id: lockversion
5357
- if: steps.packagejson.outputs.exists == 'true'
5458
name: Setup Node.js
55-
uses: actions/setup-node@v2
59+
uses: actions/setup-node@v3
5660
with:
57-
node-version: 14
61+
node-version: "${{ steps.lockversion.outputs.version }}"
5862
cache: 'npm'
5963
cache-dependency-path: '**/package-lock.json'
6064
- if: steps.packagejson.outputs.exists == 'true'

0 commit comments

Comments
 (0)