Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_node_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
description: 'JSON array of Node.js versions and parameters'
required: false
type: string
default: '[{"version": "20", "tests": true, "lint": true}]'
default: '[{"version": "24", "tests": true, "lint": true}]'

jobs:
build:
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/build_node_package_with_pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: Build and test npm package with PostgreSQL service
on:
workflow_call:
inputs:
run_tests:
description: 'Run tests'
node:
description: 'JSON array of Node.js versions and parameters'
required: false
type: boolean
default: false
type: string
default: '[{"version": "24", "tests": true, "lint": true}]'

jobs:
build:
Expand All @@ -27,22 +27,23 @@ jobs:
- 5432:5432
strategy:
matrix:
node-version: [20.x]
node: ${{ fromJson(inputs.node)}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is fromJson defined?

because assuming it's parsing [{"version": "24", "tests": true, "lint": true}] it needs to output [ 24 ]

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://docs.github.com/en/actions/reference/workflows-and-actions/expressions#fromjson

It outputs a node object with version, tests and lint keys .

Copy link
Collaborator Author

@ppawlowski ppawlowski Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See how it works in the Build and test npm package reusable workflow

steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Use Node.js ${{ inputs.node_version }}
- name: Use Node.js ${{ matrix.node.version }}
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
with:
node-version: ${{ inputs.node_version }}
node-version: ${{ matrix.node.version }}

- name: Install Dependencies
run: npm ci

- name: Run lint
if: ${{ fromJson(matrix.node.lint) }}
run: npm run lint

- name: Run tests
if: ${{ fromJson(inputs.run_tests) }}
if: ${{ fromJson(matrix.node.tests) }}
run: npm run test
2 changes: 1 addition & 1 deletion .github/workflows/publish_node_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
description: 'Node.js version'
required: false
type: string
default: '20'
default: '24'
npm_registry_url:
description: 'NPM registry URL'
required: false
Expand Down
Loading