Skip to content

Commit

Permalink
setup node
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Fernandes committed Jan 23, 2024
1 parent ef59625 commit 6948398
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Setup node
description: "Prepare node env and SSH key (needs to be run after checkout code)"
inputs:
node-version:
description: "Node version"
required: false
default: "18"

runs:
using: "composite"
steps:
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
cache: "npm"
node-version: ${{ inputs.node-version }}
registry-url: https://npm.pkg.github.com/
scope: "@rows"
cache-dependency-path: "**/package-lock.json"
7 changes: 7 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- uses: ./.github/actions/setup-node
with:
ssh-key: ${{ secrets.SSH_KEY }}
known-hosts: ${{ secrets.KNOWN_HOSTS }}

- name: Audit dependencies
run: npm audit --production --audit-level=high

Expand All @@ -24,6 +29,8 @@ jobs:
with:
fetch-depth: 0

- uses: ./.github/actions/setup-node

- uses: ./.github/actions/install-dependencies
with:
node-auth-token: ${{ secrets.NODE_AUTH_TOKEN }}
Expand Down

0 comments on commit 6948398

Please sign in to comment.