Skip to content

Commit

Permalink
feat(action): add option to specify package.json file path
Browse files Browse the repository at this point in the history
  • Loading branch information
svierk committed Jul 4, 2024
1 parent fe9414c commit 837a2d5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@ branding:
icon: 'search'
color: 'green'

inputs:
path:
description: 'Specify the path where the package.json file can be found.'
required: false
default: './package.json'

runs:
using: composite
steps:
- name: Get Node.js Version
shell: bash
run: |
echo "$(cat ./package.json)" | jq .engines.node | xargs -I {} echo "NodeVersion="{} >> $GITHUB_ENV
echo "$(cat ${{ inputs.path }})" | jq .engines.node | xargs -I {} echo "NodeVersion="{} >> $GITHUB_ENV
- name: Use Node.js ${{ env.NodeVersion }}
uses: actions/setup-node@main
with:
Expand Down

0 comments on commit 837a2d5

Please sign in to comment.