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
17 changes: 0 additions & 17 deletions .ghadocs.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/__main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
release:
needs: ci
if: github.event_name != 'schedule'
uses: hoverkraft-tech/ci-github-publish/.github/workflows/release-actions.yml@00adc3757296add499b60fd72a124b06974a100e # 0.10.1
uses: hoverkraft-tech/ci-github-publish/.github/workflows/release-actions.yml@42d50a3461a177557ca3f83b1d927d7c0783c894 # 0.11.2
with:
update-all: ${{ (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || github.event_name == 'workflow_dispatch' }}
github-app-id: ${{ vars.CI_BOT_APP_ID }}
Expand Down
166 changes: 124 additions & 42 deletions .github/workflows/continuous-integration.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
<!-- start title -->
<!-- header:start -->

# GitHub Reusable Workflow: Node.js Continuous Integration

<!-- end title -->
<!-- start description -->
<div align="center">
<img src="https://opengraph.githubassets.com/e970d0dbe9ef0b2c9d7908a082cdee394d80b51dbba83dab5821ba6e49341f8d/hoverkraft-tech/ci-github-nodejs" width="60px" align="center" alt="NodeJS Continuous Integration" />
</div>

---

<!-- header:end -->

<!-- badges:start -->

[![Release](https://img.shields.io/github/v/release/hoverkraft-tech/ci-github-nodejs)](https://github.com/hoverkraft-tech/ci-github-nodejs/releases)
[![License](https://img.shields.io/github/license/hoverkraft-tech/ci-github-nodejs)](http://choosealicense.com/licenses/mit/)
[![Stars](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-nodejs?style=social)](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-nodejs?style=social)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/hoverkraft-tech/ci-github-nodejs/blob/main/CONTRIBUTING.md)

<!-- badges:end -->

<!-- overview:start -->

## Overview

Workflow to performs continuous integration steps agains a Node.js project:

Expand All @@ -12,68 +30,99 @@ Workflow to performs continuous integration steps agains a Node.js project:
- Build
- Test

<!-- end description -->
<!-- start contents -->
<!-- end contents -->
<!-- start usage -->
### Permissions

```yaml
name: Nodejs Continuous Integration
- **`contents`**: `read`
- **`security-events`**: `write`
- **`id-token`**: `write`

<!-- overview:end -->

<!-- usage:start -->

## Usage

```yaml
name: NodeJS Continuous Integration
on:
merge_group:
push:
branches: [main]
pull_request:
branches: [main]

branches:
- main
permissions:
contents: read
security-events: write
# FIXME: This is a workaround for having workflow ref. See https://github.com/orgs/community/discussions/38659
id-token: write

jobs:
continuous-integration:
uses: hoverkraft-tech/ci-github-nodejs/.github/workflows/continuous-integration.yml@0.14.1
uses: hoverkraft-tech/ci-github-nodejs/.github/workflows/continuous-integration.yml@1d00c9eb280acbee5df4b4a2087f786e66b13d87 # 0.14.1
with:
# Build parameters. Must be a string or a json object.
# Default: `build`
build: build

# Optional flag to enable check steps.
# Default: `true`
checks: true

# Optional flag to enable linting.
# Default: `true`
lint: true

# Code QL analysis language. See <https://github.com/github/codeql-action>.
# Default: `typescript`
code-ql: typescript

# Enable dependency review scan. See <https://github.com/actions/dependency-review-action>.
# Default: `true`
dependency-review: true

# Optional flag to enable test.
# Default: `true`
test: true

# Specifify code coverage reporter. Supported values: 'codecov'.
# Default: `codecov`
coverage: codecov

# Working directory where the dependencies are installed.
# Default: `.`
working-directory: .
```

<!-- end usage -->
<!-- start secrets -->
<!-- end secrets -->
<!-- start inputs -->
<!-- usage:end -->

<!-- inputs:start -->

## Inputs

| **Input** | **Description** | **Type** | **Default** | **Required** |
| ------------------------- | ------------------------------------------------------------------------- | -------------------- | ------------------------- | ------------ |
| **<code>build</code>** | Build parameters. Must be a string or a JSON array of strings or object. | <code>string</code> | <code>build</code> | **false** |
| **<code>checks</code>** | Optional flag to enable check steps. | <code>boolean</code> | <code>true</code> | **false** |
| **<code>code-ql</code>** | Code QL analysis language. See <https://github.com/github/codeql-action>. | <code>string</code> | <code>`typescript`</code> | **false** |
| **<code>lint</code>** | Optional flag to enable linting. | <code>boolean</code> | <code>true</code> | **false** |
| **<code>test</code>** | Optional flag to enable test. | <code>boolean</code> | <code>true</code> | **false** |
| **<code>coverage</code>** | Specifify code coverage reporter. Supported values: `codecov`. | <code>string</code> | <code>`codecov`</code> | **false** |
### Workflow Call Inputs

| **Input** | **Description** | **Required** | **Type** | **Default** |
| ----------------------- | ----------------------------------------------------------------------------------------- | ------------ | ----------- | ------------ |
| **`build`** | Build parameters. Must be a string or a JSON object. | **false** | **string** | `build` |
| **`checks`** | Optional flag to enable check steps. | **false** | **boolean** | `true` |
| **`lint`** | Optional flag to enable linting. | **false** | **boolean** | `true` |
| **`code-ql`** | Code QL analysis language. See <https://github.com/github/codeql-action>. | **false** | **string** | `typescript` |
| **`dependency-review`** | Enable dependency review scan. See <https://github.com/actions/dependency-review-action>. | **false** | **boolean** | `true` |
| **`test`** | Optional flag to enable test. | **false** | **boolean** | `true` |
| **`coverage`** | Specifify code coverage reporter. Supported values: 'Codecov'. | **false** | **string** | `codecov` |
| **`working-directory`** | Working directory where the dependencies are installed. | **false** | **string** | `.` |

### `build` input parameters
<!-- inputs:end -->

When `build` is a JSON object, the following parameters are supported:
<!-- secrets:start -->
<!-- secrets:end -->

| **Input** | **Description** | **Type** | **Default** | **Required** |
| ---------- | -------------------------------------------------------------------------------------------------------- | ------------------ | ----------- | ------------ |
| `commands` | Build command(s). | string[] | `["build"]` | **false** |
| `artifact` | Build artifact (name will be `build`) to be uploaded. (See <https://github.com/actions/upload-artifact>) | string or string[] | `` | **false** |
<!-- outputs:start -->
<!-- outputs:end -->

<!-- end inputs -->
<!-- start outputs -->
<!-- end outputs -->
<!-- start [.github/ghadocs/examples/] -->
<!-- examples:start -->

## Examples

### Continuous Integration, build and publish

```yaml

name: Continuous Integration - Build and Publish

name: Nodejs Continuous Integration
Expand All @@ -84,7 +133,7 @@ on:

jobs:
continuous-integration:
uses: hoverkraft-tech/ci-github-nodejs/.github/workflows/continuous-integration.yml@0.14.1
uses: hoverkraft-tech/ci-github-nodejs/.github/workflows/continuous-integration.yml@1d00c9eb280acbee5df4b4a2087f786e66b13d87 # 0.14.1
permissions:
id-token: write
security-events: write
Expand Down Expand Up @@ -119,4 +168,37 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
```

<!-- end [.github/ghadocs/examples/] -->
<!-- examples:end -->

<!-- contributing:start -->

## Contributing

Contributions are welcome! Please see the [contributing guidelines](https://github.com/hoverkraft-tech/ci-github-nodejs/blob/main/CONTRIBUTING.md) for more details.

<!-- contributing:end -->

<!-- security:start -->
<!-- security:end -->

<!-- license:start -->

## License

This project is licensed under the MIT License.

SPDX-License-Identifier: MIT

Copyright © 2025 hoverkraft-tech

For more details, see the [license](http://choosealicense.com/licenses/mit/).

<!-- license:end -->

<!-- generated:start -->

---

This documentation was automatically generated by [CI Dokumentor](https://github.com/hoverkraft-tech/ci-dokumentor).

<!-- generated:end -->
7 changes: 3 additions & 4 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# NodeJS Continuous Integration
# ==========================
# Workflow to performs continuous integration steps agains a NodeJs project:
#
# - CodeQL analysis
# - Linting
# - Build
Expand Down Expand Up @@ -67,10 +66,10 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- uses: hoverkraft-tech/ci-github-common/actions/checkout@1c379f7f6e0fc850fe5a7111f74d54e159b4dcd2 # 0.26.0
- uses: github/codeql-action/init@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.30.6
- uses: github/codeql-action/init@e296a935590eb16afc0c0108289f68c87e2a89a5 # v4.30.7
with:
languages: ${{ inputs.code-ql }}
- uses: github/codeql-action/analyze@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.30.6
- uses: github/codeql-action/analyze@e296a935590eb16afc0c0108289f68c87e2a89a5 # v4.30.7

dependency-review:
name: 🛡️ Dependency Review
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#checkov:skip=CKV_DOCKER_2: required
FROM ghcr.io/super-linter/super-linter:slim-v8
FROM ghcr.io/super-linter/super-linter:slim-v8.0.0

HEALTHCHECK --interval=5m --timeout=10s --start-period=30s --retries=3 CMD ["/bin/sh","-c","test -d /github/home"]
ARG UID=1000
ARG GID=1000
RUN chown -R ${UID}:${GID} /github/home
Expand All @@ -9,4 +9,4 @@ USER ${UID}:${GID}
ENV RUN_LOCAL=true
ENV USE_FIND_ALGORITHM=true
ENV LOG_LEVEL=WARN
ENV LOG_FILE="/github/home/logs"
ENV LOG_FILE="/github/home/logs"
Loading
Loading