Skip to content

Commit

Permalink
fix: install renovate required nodejs by default
Browse files Browse the repository at this point in the history
  • Loading branch information
korosuke613 committed Oct 7, 2024
1 parent af00ba1 commit 174b31e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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:
Expand Down

0 comments on commit 174b31e

Please sign in to comment.