-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: install renovate required nodejs by default
- Loading branch information
1 parent
af00ba1
commit 174b31e
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,10 @@ inputs: | |
description: 'Renovate git author' | ||
required: false | ||
default: "GitHub Action <[email protected]>" | ||
install-nodejs: | ||
description: 'if `true`, install Renovate required Node.js' | ||
required: false | ||
default: "true" | ||
|
||
runs: | ||
using: "composite" | ||
|
@@ -54,6 +58,28 @@ runs: | |
# Create a path to save a action summary. | ||
echo "summary=${{ runner.temp }}/summary.md" >> $GITHUB_OUTPUT | ||
# Output Renovate required node version | ||
echo "renovate-required-node-version=$(npm view renovate --json | jq '.engines.node')" >> $GITHUB_OUTPUT | ||
- name: Get Renovate required minimum node version | ||
if: inputs.install-nodejs == 'true' | ||
uses: actions/github-script@v7 | ||
id: renovate-required-minimum-node-version | ||
env: | ||
RENOVATE_REQUIRED_NODE_VERSION: ${{ steps.setup.outputs.renovate-required-node-version }} | ||
with: | ||
result-encoding: string | ||
script: | | ||
const semver = require('semver'); | ||
const minVersion = semver.minVersion(process.env.RENOVATE_REQUIRED_NODE_VERSION); | ||
return minVersion.version; | ||
- name: Setup Node.js | ||
if: inputs.install-nodejs == 'true' | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ steps.renovate-required-minimum-node-version.outputs.data }} | ||
|
||
- uses: actions/cache@v4 | ||
if: inputs.cache == 'true' | ||
with: | ||
|