Skip to content

Commit 2908cea

Browse files
authored
fix(worflows/ci): make .nvmrc be used over the default node version (#299)
1 parent 124ff1c commit 2908cea

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,13 @@ jobs:
279279
- name: Setup
280280
uses: grafana/plugin-ci-workflows/actions/plugins/setup@main
281281
with:
282-
go-version: ${{ inputs.go-version || env.DEFAULT_GO_VERSION }}
283-
node-version: ${{ inputs.node-version || env.DEFAULT_NODE_VERSION }}
282+
# The priority to setup the node version is:
283+
# 1. inputs.node-version
284+
# 2. inputs.plugin-directory/.nvmrc
285+
# 3. workflow-level DEFAULT_NODE_VERSION
286+
node-version: ${{ inputs.node-version || (hashFiles(format('{0}/.nvmrc', inputs.plugin-directory)) == '' && env.DEFAULT_NODE_VERSION || '') }}
284287
node-version-file: ${{ inputs.plugin-directory }}/.nvmrc
288+
go-version: ${{ inputs.go-version || env.DEFAULT_GO_VERSION }}
285289
golangci-lint-version: ${{ inputs.golangci-lint-version || env.DEFAULT_GOLANGCI_LINT_VERSION }}
286290
go-setup-caching: ${{ inputs.go-setup-caching }}
287291

0 commit comments

Comments
 (0)