Skip to content

Commit d1a25fc

Browse files
committed
[FIX] config: move to ESM release tool
In a nutshell, actions/toolkit#2272 broke commonjs compatibility with 0 proper documentation actions/toolkit#2287 which definitely helped debugging, really. Claude was lost, really fun to see it drool and try to fix imaginary stuff. We move our `parse_message` file to esm to satisfy the requirements of the latest `@action/core` requirement as it seems overall preferable to freeze the package versions for the future. We also freeze the @actions packages versions in case they pull another one. closes #8233 Task: sotg X-original-commit: 53ec6b1 Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com> Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
1 parent 819c58e commit d1a25fc

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ jobs:
88
if: contains(github.event.head_commit.message, '[REL]')
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v3
12-
- uses: actions/setup-node@v3
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-node@v6
1313
with:
1414
registry-url: 'https://registry.npmjs.org'
1515
- name: Parse
1616
id: parse
1717
# should work with le latest stable node
1818
# parse-message will fail on invalid commit title/body
1919
run: |
20-
npm i @actions/core @actions/github --no-save &&\
21-
node tools/parse_message.cjs
20+
npm i @actions/core@3.0.0 @actions/github@9.0.0 --no-save &&\
21+
node tools/parse_message.mjs
2222
# generate all builds
2323
- name: Build
2424
run: npm ci && npm run dist

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ tests/**/xlsx_demo_data
2222
**/*.xltx
2323
**/*.xltm
2424
**/*.xlam
25+
tools/parse_message.mjs
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
* https://github.com/nektos/act
2222
*/
2323

24-
const core = require("@actions/core");
25-
const github = require("@actions/github");
26-
const path = require("path");
27-
28-
const package = require(path.join(__dirname, "../package.json"));
24+
import * as core from "@actions/core";
25+
import * as github from "@actions/github";
26+
// Prettier 2.x cannot parse this expression, it requires Prettier 3.x which will probably bring other changes.
27+
// For now, we can ignore this file in the Prettier configuration and format it manually.
28+
import pack from '../package.json' with { type: 'json' };
2929

3030
function trim(array) {
3131
while (["", "\n"].includes(array[0])) {
@@ -50,7 +50,7 @@ try {
5050
trim(commitLines);
5151

5252
// find version
53-
const version = package.version;
53+
const version = pack.version;
5454

5555
core.setOutput("title", title);
5656
core.setOutput("version", version);

0 commit comments

Comments
 (0)