Skip to content

Commit 9608f80

Browse files
committed
[FIX] config: fix release flow
Apparentlyn relying on a JSON output was not a good idea and might have been dropepd by github recently (over the last months). This PR fixes the flow by outputting the variables independently without relying on a JSON pack/unpack which is ultimately more efficient. closes #8187 Task: 0 X-original-commit: 1d55895 Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com> Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
1 parent 7d5cc3a commit 9608f80

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ jobs:
1818
# parse-message will fail on invalid commit title/body
1919
run: |
2020
npm i @actions/core @actions/github --no-save &&\
21-
echo "data=$(node tools/parse_message.cjs)" >> $GITHUB_OUTPUT
21+
node tools/parse_message.cjs
2222
# generate all builds
2323
- name: Build
2424
run: npm ci && npm run dist
2525
- name: Release
2626
uses: ncipollo/release-action@v1.12.0
2727
with:
28-
tag: ${{ fromJSON(steps.parse.outputs.data).version }}
29-
body: ${{ fromJSON(steps.parse.outputs.data).body }}
28+
tag: ${{ steps.parse.outputs.version }}
29+
body: ${{ steps.parse.outputs.body }}
3030
artifacts: "./dist/*.*"
3131
makeLatest: false
32-
prerelease: ${{ fromJSON(steps.parse.outputs.data).prerelease }}
32+
prerelease: ${{ steps.parse.outputs.prerelease }}
3333
- name: Publish
3434
run: npm publish
3535
env:

tools/parse_message.cjs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,10 @@ try {
5252
// find version
5353
const version = package.version;
5454

55-
console.log(
56-
JSON.stringify({
57-
title,
58-
version,
59-
body: commitLines.join("\n"),
60-
prerelease: version.includes("alpha"),
61-
})
62-
);
55+
core.setOutput("title", title);
56+
core.setOutput("version", version);
57+
core.setOutput("body", commitLines.join("\n"));
58+
core.setOutput("prerelease", version.includes("alpha"));
6359
} catch (error) {
6460
core.setFailed(error.message);
6561
}

0 commit comments

Comments
 (0)