Skip to content
Draft
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
10 changes: 8 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: '/'
directory: /
schedule:
interval: daily
interval: weekly
open-pull-requests-limit: 10
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
cooldown:
default-days: 5
34 changes: 18 additions & 16 deletions .github/workflows/doctoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ name: Check generated TOCs
on:
pull_request:
paths:
- 'README.md'
- 'docs/BestPractices.md'
- '.github/workflows/doctoc.yml'
- README.md
- CONTRIBUTING.md
- docs/BestPractices.md
- .github/workflows/doctoc.yml
Comment thread
MikeMcC399 marked this conversation as resolved.
- 'package*.json'
workflow_dispatch:

permissions:
contents: read
Expand All @@ -15,17 +18,16 @@ jobs:
name: Doc TOC Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
- name: Check out repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 'lts/*'
- name: Install doctoc
run: npm i -g doctoc
- name: Create README copy and diff with doctoc
run: cp README.md README.md.tmp &&
doctoc --title='## Table of Contents' --github README.md &&
diff -q README.md README.md.tmp
- name: Create "docs/BestPractices.md" copy and diff with doctoc
run: cp docs/BestPractices.md docs/BestPractices.md.tmp &&
doctoc --title='## Table of Contents' --github docs/BestPractices.md &&
diff -q docs/BestPractices.md docs/BestPractices.md.tmp
node-version-file: .node-version
cache: npm
- name: Install dependencies
run: npm ci
- name: Run doctoc
run: npx doctoc --update-only .

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
run: npx doctoc --update-only .
run: npm run format:toc

- name: Check for changes
run: git diff --exit-code
21 changes: 13 additions & 8 deletions .github/workflows/markdown-link-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ on:
pull_request:
paths:
- '**/*.md'
- 'markdown_link_check_config.json'
- '.github/workflows/markdown-link-check.yml'
- markdown_link_check_config.json
- .github/workflows/markdown-link-check.yml
Comment thread
MikeMcC399 marked this conversation as resolved.
- 'package*.json'
workflow_dispatch:

permissions:
contents: read
Expand All @@ -14,11 +16,14 @@ jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
- name: Check out repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 'lts/*'
- name: Install markdown-link-check
run: npm i -g markdown-link-check@3.14.2
node-version-file: .node-version

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is picked up automatically and doesn't need to be configured

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If neither node-version nor node-version-file is specified, then setup-node uses the default version of the runner, in this case ubuntu-latest => ubuntu-24.04 has Node.js 22.23.1 as default.

I did try it out, just to make sure. So this needs to stay as it is.

cache: npm
- name: Install dependencies
run: npm ci
- name: Run markdown-link-check on MD files
run: find . -name "*.md" | xargs -n 1 markdown-link-check -c markdown_link_check_config.json -q
run: npm run check:markdown-links
16 changes: 11 additions & 5 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Check Prettier formatting

on: [pull_request]
on: [pull_request, workflow_dispatch]

permissions:
contents: read
Expand All @@ -9,8 +9,14 @@ jobs:
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
- name: Check out repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 'lts/*'
- run: npx prettier@3.9.5 --check .
node-version-file: .node-version
cache: npm
- name: Install dependencies
run: npm ci
- name: Run Prettier
run: npx prettier --check .

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
run: npx prettier --check .
run: npm run format:prettier:check

Better to call the configured target

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
min-release-age=5
save-exact=true
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
83 changes: 77 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
# Contributing to docker-node

Thank you for your contribution. Here are a set of guidelines for contributing to the docker-node project.
Thank you for your contribution. Here are guidelines for contributing to the docker-node project.

<!-- prettier-ignore-start -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Table of Contents

- [Governance and decision making](#governance-and-decision-making)
- [Discussion Areas](#discussion-areas)
- [Prerequisites](#prerequisites)
- [Pull requests](#pull-requests)
- [Linting](#linting)
- [Link checks](#link-checks)
- [Version Updates](#version-updates)
- [Image Creation Automation](#image-creation-automation)
- [Image Creation Manually](#image-creation-manually)
- [Adding dependencies to the base images](#adding-dependencies-to-the-base-images)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- prettier-ignore-end -->

## Governance and decision making

Expand All @@ -24,6 +43,60 @@ You can use Node.js channels (prefixed by `#nodejs-`) in the [OpenJSF Slack](htt

- [#nodejs-release](https://openjs-foundation.slack.com/archives/C019MGJQ8RH) is linked to the [Node.js Release Working Group](https://github.com/nodejs/release#readme) responsible for the upstream releases of Node.js used by this repo.

## Prerequisites

To contribute to this repo, install:

- [git](https://git-scm.com/)
- [Docker](https://docs.docker.com/get-started/get-docker/)
- [Node.js](https://nodejs.org/en/download) LTS version as specified in [.node-version](./.node-version)

[fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) and [clone](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) this repo, then install npm dependencies.
Replace `<my-github-username>` with the username of your fork in the instructions below:

```shell
git clone https://github.com/<my-github-username>/docker-node
cd docker-node
git remote add upstream https://github.com/nodejs/docker-node
git remote update
npm ci # install npm dependencies
```

## Pull requests

Contributions are handled through GitHub pull requests. Branch from the default branch `main` and create a new branch, for example:

```shell
git checkout main
git checkout -b my-branch
```

Make changes in your branch and then submit your contribution as a [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) (PR), targeting the branch `main`.

## Linting

After making changes, execute the following to check for correct formatting. This runs the linting scripts `format:toc` and `format:prettier`. Check the output to see if there are any formatting issues that need manual correction:

```shell
npm run lint
```

Alternatively use any of the following commands to call one of the underlying linting utilities:

| Command | Purpose |
| ------------------------------- | --------------------------------------- |
| `npm run format:toc` | Reformats any Table of Contents |
| `npm run format:prettier` | Reformats multiple types of source code |
| `npm run format:prettier:check` | Read-only prettier check |

## Link checks

Execute the following to check links in Markdown files:

```shell
npm run check:markdown-links
```

## Version Updates

New **Node.js** releases are released as soon as possible.
Expand Down Expand Up @@ -59,14 +132,12 @@ If you believe there is a need for a manual PR, and you are not a member of the
please first open an issue to describe the update problem
and your suggestion to resolve it.

To set up a version update PR, follow these instructions:
To set up a version update pull request, see the [Pull Requests](#pull-requests) section above and follow these instructions:

1. [Fork this project.](https://docs.github.com/en/get-started/quickstart/fork-a-repo)
1. [Clone the forked repository.](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository)
1. Create a branch for the update PR. For example, `git checkout main; git checkout -b version-update`.
1. Create a `version-update` branch
1. Run `./update.sh`. You can see additional options by using the built-in help documentation with `./update.sh -h`. This script will automatically update the appropriate files with the latest versions and checksums.
1. Commit the modified files to the `version-update` branch and push the branch to your fork.
1. [Create a PR to merge the branch from your fork into this project's default branch.](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork).
1. Create a pull request.

When a new Node.js release line is expected, additional preparation is necessary, including updates to the
[versions.json](./versions.json) file and creation of a major version directory, populated with generated files.
Expand Down
Loading