Skip to content

Latest commit

 

History

History
178 lines (137 loc) · 11.2 KB

README.md

File metadata and controls

178 lines (137 loc) · 11.2 KB

Icon GitHub Action: Build

Build

Marketplace Release License Stars PRs Welcome GitHub Verified Creator

Overview

Action to build Node.js projects with support for custom commands, environment variables, and artifact handling

Usage

- uses: hoverkraft-tech/ci-github-nodejs/actions/build@64632ba90b771d20337b737d8b0ccee0cb7bae58 # 3.1.2
  with:
    # Disable project and dependency lifecycle scripts during installation.
    # Set false to allow installation hooks, subject to the package manager's script approval settings.
    # Explicit commands are unaffected. Does not apply in container mode, which skips installation.
    #
    # Default: `true`
    ignore-scripts: "true"

    # Working directory where the build commands are executed.
    # Can be absolute or relative to the repository root.
    #
    # Default: `.`
    working-directory: .

    # List of build commands to execute, one per line.
    # These are npm/pnpm/Yarn script names (e.g., `build`, `compile`).
    #
    # This input is required.
    build-commands: ""

    # JSON object of environment variables to set during the build.
    # Example:
    #
    # ```json
    # {
    # "NODE_ENV": "production",
    # "API_URL": "https://api.example.com"
    # }
    # ```
    #
    # Default: `{}`
    build-env: "{}"

    # Multi-line string of secrets in env format (`KEY=VALUE`).
    # Example:
    # ```txt
    # SECRET_KEY=$\{{ secrets.SECRET_KEY }}
    # API_TOKEN=$\{{ secrets.API_TOKEN }}
    # ```
    build-secrets: ""

    # JSON object specifying artifact upload configuration.
    # Example:
    #
    # ```json
    # {
    # "name": "artifact-name",
    # "paths": "path1\npath2"
    # }
    # ```
    build-artifact: ""

    # Whether running in container mode (skips checkout and node setup)
    # Default: `false`
    container: "false"

Inputs

Input Description Required Default
ignore-scripts Disable project and dependency lifecycle scripts during installation. false true
Set false to allow installation hooks, subject to the package manager's script approval settings.
Explicit commands are unaffected. Does not apply in container mode, which skips installation.
working-directory Working directory where the build commands are executed. false .
Can be absolute or relative to the repository root.
build-commands List of build commands to execute, one per line. true -
These are npm/pnpm/Yarn script names (e.g., build, compile).
build-env JSON object of environment variables to set during the build. false {}
Example:
{
 "NODE_ENV": "production",
 "API_URL": "https://api.example.com"
}
build-secrets Multi-line string of secrets in env format (KEY=VALUE). false -
Example:
SECRET_KEY=${{ secrets.SECRET_KEY }}
API_TOKEN=${{ secrets.API_TOKEN }}
build-artifact JSON object specifying artifact upload configuration. false -
Example:
{
 "name": "artifact-name",
 "paths": "path1\npath2"
}
container Whether running in container mode (skips checkout and node setup) false false

Outputs

Output Description
artifact-id ID of the uploaded artifact (if artifact was specified)

Contributing

Contributions are welcome! Please see the contributing guidelines for more details.

License

This project is licensed under the MIT License.

SPDX-License-Identifier: MIT

Copyright © 2026 hoverkraft

For more details, see the license.


This documentation was automatically generated by CI Dokumentor.