Skip to content

Commit 4632a7c

Browse files
committed
chore: sync shared action improvements from #564
# Conflicts: # README.md # docs/development/dependency-updates.md
2 parents a737d06 + 81cca50 commit 4632a7c

5 files changed

Lines changed: 53 additions & 21 deletions

File tree

‎.github/renovate.json‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": ["config:recommended"],
4-
"enabledManagers": ["github-actions", "nodenv"],
4+
"enabledManagers": ["github-actions", "nodenv", "custom.regex"],
55
"semanticCommits": "enabled",
66
"minimumReleaseAge": "7 days",
77
"minimumReleaseAgeBehaviour": "timestamp-optional",
@@ -24,6 +24,25 @@
2424
"matchFileNames": [".node-version"],
2525
"enabled": true,
2626
"automerge": false
27+
},
28+
{
29+
"description": "Update the pnpm fallback used when projects do not declare packageManager.",
30+
"matchManagers": ["custom.regex"],
31+
"matchPackageNames": ["pnpm"],
32+
"enabled": true,
33+
"automerge": false
34+
}
35+
],
36+
"customManagers": [
37+
{
38+
"customType": "regex",
39+
"managerFilePatterns": ["/^actions/setup-node/action\\.yml$/"],
40+
"matchStrings": [
41+
"DEFAULT_PNPM_VERSION: \"(?<currentValue>[^\"\\r\\n]+)\""
42+
],
43+
"datasourceTemplate": "npm",
44+
"depNameTemplate": "pnpm",
45+
"versioningTemplate": "npm"
2746
}
2847
]
2948
}

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ _Actions focused on discovering and preparing the Node.js environment._
6868

6969
### Continuous Integration
7070

71-
- [Continuous Integration](.github/workflows/continuous-integration.md) — documentation for the reusable Node.js CI workflow.
71+
- [Continuous Integration](.github/workflows/continuous-integration.md): documentation for the reusable Node.js CI workflow.
7272

7373
### Release
7474

75-
- [Release packages](.github/workflows/release.md) — setup, manual and scheduled releases, recovery and workflow reference.
75+
- [Release packages](.github/workflows/release.md): setup, manual and scheduled releases, recovery and workflow reference.
7676

7777
## Contributing
7878

‎actions/setup-node/README.md‎

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ Action to setup Node.js and install dependencies according to the package manage
3636
```yaml
3737
- uses: hoverkraft-tech/ci-github-nodejs/actions/setup-node@<sha>
3838
with:
39-
# Install project dependencies after configuring the package manager and Node.js runtime. Set false for packaging an existing CI build.
39+
# Install project dependencies after configuring Node.js and the package manager.
40+
# Set false when only tooling is needed, such as packaging prepared build files,
41+
# or when the caller manages dependency installation separately.
42+
#
4043
# Default: `true`
4144
install-dependencies: "true"
4245

@@ -67,17 +70,19 @@ Action to setup Node.js and install dependencies according to the package manage
6770
6871
## Inputs
6972
70-
| **Input** | **Description** | **Required** | **Default** |
71-
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ----------- |
72-
| **`install-dependencies`** | Install project dependencies after configuring the package manager and Node.js runtime. Set false for packaging an existing CI build. | **false** | `true` |
73-
| **`ignore-scripts`** | Disable project and dependency lifecycle scripts during installation. | **false** | `true` |
74-
| | Set false to allow installation hooks, subject to the package manager's script approval settings. | | |
75-
| | Explicit commands run after installation are unaffected. | | |
76-
| **`dependencies-cache`** | List of dependencies for which the cache should be managed | **false** | - |
77-
| **`working-directory`** | Working directory where the dependencies are installed. | **false** | `.` |
78-
| | Can be absolute or relative to the repository root. | | |
79-
| **`registry-url`** | Optional registry to set up for auth. | **false** | - |
80-
| | See <https://github.com/actions/setup-node?tab=readme-ov-file#usage>. | | |
73+
| **Input** | **Description** | **Required** | **Default** |
74+
| -------------------------- | ------------------------------------------------------------------------------------------------- | ------------ | ----------- |
75+
| **`install-dependencies`** | Install project dependencies after configuring Node.js and the package manager. | **false** | `true` |
76+
| | Set false when only tooling is needed, such as packaging prepared build files, | | |
77+
| | or when the caller manages dependency installation separately. | | |
78+
| **`ignore-scripts`** | Disable project and dependency lifecycle scripts during installation. | **false** | `true` |
79+
| | Set false to allow installation hooks, subject to the package manager's script approval settings. | | |
80+
| | Explicit commands run after installation are unaffected. | | |
81+
| **`dependencies-cache`** | List of dependencies for which the cache should be managed | **false** | - |
82+
| **`working-directory`** | Working directory where the dependencies are installed. | **false** | `.` |
83+
| | Can be absolute or relative to the repository root. | | |
84+
| **`registry-url`** | Optional registry to set up for auth. | **false** | - |
85+
| | See <https://github.com/actions/setup-node?tab=readme-ov-file#usage>. | | |
8186

8287
<!-- inputs:end -->
8388

‎actions/setup-node/action.yml‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ branding:
77

88
inputs:
99
install-dependencies:
10-
description: Install project dependencies after configuring the package manager and Node.js runtime. Set false for packaging an existing CI build.
10+
description: |
11+
Install project dependencies after configuring Node.js and the package manager.
12+
Set false when only tooling is needed, such as packaging prepared build files,
13+
or when the caller manages dependency installation separately.
1114
default: "true"
1215
ignore-scripts:
1316
description: |
@@ -102,6 +105,8 @@ runs:
102105
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
103106
env:
104107
WORKING_DIRECTORY: ${{ steps.working-directory.outputs.absolute-path }}
108+
# Updated by Renovate; keep the fallback version in one place.
109+
DEFAULT_PNPM_VERSION: "12.16.1"
105110
with:
106111
script: |
107112
const path = require('node:path');
@@ -114,7 +119,7 @@ runs:
114119
let packageJsonPath = path.join(workingDirectory, 'package.json');
115120
if (!fs.existsSync(packageJsonPath)) {
116121
core.debug(`package.json not found in working directory "${workingDirectory}"; using the supported pnpm default`);
117-
core.setOutput('pnpm-version', '12.16.1');
122+
core.setOutput('pnpm-version', process.env.DEFAULT_PNPM_VERSION);
118123
return;
119124
}
120125
packageJsonPath = path.resolve(packageJsonPath);
@@ -136,7 +141,7 @@ runs:
136141
}
137142
138143
core.debug('packageManager field missing; using the supported pnpm default');
139-
core.setOutput('pnpm-version', '12.16.1');
144+
core.setOutput('pnpm-version', process.env.DEFAULT_PNPM_VERSION);
140145
141146
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
142147
if: steps.get-package-manager.outputs.package-manager == 'pnpm'

‎docs/development/dependency-updates.md‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
[Dependabot](../../.github/dependabot.yml) remains the primary updater for npm,
44
GitHub Actions, Dockerfiles and development containers.
55
[Renovate](../../.github/renovate.json) handles the root
6-
[`.node-version`](../../.node-version) and `docker://` action references. Other
7-
dependencies stay disabled in Renovate to avoid duplicate update pull requests.
6+
[`.node-version`](../../.node-version), `docker://` action references and the
7+
`DEFAULT_PNPM_VERSION` fallback in [Setup Node.js](../../actions/setup-node/action.yml).
8+
The pnpm fallback is tracked as an npm dependency through a scoped regular expression manager.
9+
A project's `package.json.packageManager` takes precedence over this fallback.
10+
Other dependencies stay disabled in Renovate to avoid duplicate update pull requests.
811
Fixture Node version files link to the root file and are not updated separately.
912

1013
The [Renovate workflow](../../.github/workflows/__renovate.yml) runs every Friday
@@ -20,7 +23,7 @@ to this repository. Renovate creates commits through GitHub's API using the App'
2023
bot identity, allowing normal PR checks to run.
2124

2225
Renovate waits seven days for releases with a known publication timestamp. It
23-
proposes Node updates for review without automerging them. Review compatibility
26+
proposes Node and pnpm fallback updates for review without automerging them. Review compatibility
2427
and the package-manager and release integration checks before merging a runtime
2528
upgrade; a newer major version may exceed a fixture dependency's supported range.
2629

0 commit comments

Comments
 (0)