Skip to content

Commit 4bb7e17

Browse files
committed
fix: remove "tmp" dependency
Trivial security issue Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
1 parent aa1ccc8 commit 4bb7e17

File tree

4 files changed

+29
-132
lines changed

4 files changed

+29
-132
lines changed

.github/workflows/release-please.yml

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -21,70 +21,48 @@ jobs:
2121
steps:
2222
- name: Initialize Release Please
2323
id: release
24-
if: ${{ github.event_name == 'push' }}
2524
uses: googleapis/release-please-action@v4
2625
with:
2726
target-branch: ${{ github.ref_name }}
2827
config-file: release-please-config.json
2928
manifest-file: .release-please-manifest.json
3029

3130
- name: Checkout Sources
32-
if: ${{ github.event_name == 'pull_request' || steps.release.outputs.release_created }}
3331
uses: actions/checkout@v4
3432

3533
- name: Install NodeJS
36-
if: ${{ github.event_name == 'pull_request' || steps.release.outputs.release_created }}
3734
uses: actions/setup-node@v6
3835
with:
3936
node-version: 22
4037
registry-url: "https://registry.npmjs.org"
4138
scope: "@hpcc-js"
4239

43-
- name: Install OS Dependencies
44-
if: ${{ github.event_name == 'pull_request' || steps.release.outputs.release_created }}
45-
run: |
46-
pip install pandas scikit-learn
47-
48-
- name: Export GitHub Actions cache environment variables
49-
if: ${{ github.event_name == 'pull_request' || steps.release.outputs.release_created }}
50-
uses: actions/github-script@v7
51-
with:
52-
script: |
53-
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
54-
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
55-
5640
- name: Install Dependencies
57-
if: ${{ github.event_name == 'pull_request' || steps.release.outputs.release_created }}
5841
run: |
5942
npm ci
6043
6144
- name: Lint
62-
if: ${{ github.event_name == 'pull_request' || steps.release.outputs.release_created }}
6345
run: |
6446
npm run lint
6547
6648
- name: Build
67-
if: ${{ github.event_name == 'pull_request' || steps.release.outputs.release_created }}
6849
run: |
6950
npm run build
7051
7152
- name: Install Test Dependencies
72-
if: ${{ github.event_name == 'pull_request' || steps.release.outputs.release_created }}
7353
run: |
7454
sudo apt-get update
7555
sudo npx -y playwright install chromium --with-deps
7656
npx -y playwright install chromium
7757
wget https://github.com/hpcc-systems/HPCC-Platform/releases/download/community_9.6.50-1/hpccsystems-platform-community_9.6.50-1jammy_amd64_withsymbols.deb
7858
7959
- name: Install HPCC Platform
80-
if: ${{ github.event_name == 'pull_request' || steps.release.outputs.release_created }}
8160
continue-on-error: true
8261
run: |
8362
sudo apt install -f ./hpccsystems-platform-community_9.6.50-1jammy_amd64_withsymbols.deb
8463
sudo /etc/init.d/hpcc-init start
8564
8665
- name: Test
87-
if: ${{ github.event_name == 'pull_request' || steps.release.outputs.release_created }}
8866
env:
8967
CI: true
9068
run: |
@@ -94,17 +72,6 @@ jobs:
9472
npm run test-node-esm
9573
npm run test-node-cjs
9674
97-
# - name: Calculate Coverage
98-
# if: ${{ steps.release.outputs.release_created }}
99-
# run: |
100-
# npm run coverage
101-
102-
# - name: Update Coveralls
103-
# if: ${{ steps.release.outputs.release_created }}
104-
# uses: coverallsapp/github-action@v2
105-
# with:
106-
# github-token: ${{ secrets.GITHUB_TOKEN }}
107-
10875
- name: push stamped release
10976
if: ${{ steps.release.outputs.release_created }}
11077
run: |
@@ -121,11 +88,6 @@ jobs:
12188
run: |
12289
npm run publish
12390
124-
# - name: Purge jsdelivr
125-
# if: ${{ steps.release.outputs.release_created }}
126-
# run: |
127-
# npm run purge-jsdelivr
128-
12991
- name: Upload error logs
13092
if: ${{ failure() || cancelled() }}
13193
uses: actions/upload-artifact@v4

package-lock.json

Lines changed: 27 additions & 91 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/comms/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
"@xmldom/xmldom": "0.9.8",
7979
"abort-controller": "3.0.0",
8080
"node-fetch": "3.3.2",
81-
"tmp": "0.2.5",
8281
"undici": "7.16.0"
8382
},
8483
"devDependencies": {

packages/comms/src/clienttools/eclcc.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as cp from "node:child_process";
2+
import * as crypto from "node:crypto";
23
import * as fs from "node:fs";
34
import * as os from "node:os";
45
import * as path from "node:path";
5-
import * as tmp from "tmp";
66

77
import { exists, scopedLogger, xml2json, XMLNode } from "@hpcc-js/util";
88
import { attachWorkspace, Workspace } from "./eclMeta.ts";
@@ -360,7 +360,7 @@ export class ClientTools {
360360
}
361361

362362
createWU(filename: string): Promise<LocalWorkunit> {
363-
const tmpName = tmp.tmpNameSync({ prefix: "eclcc-wu-tmp", postfix: "" });
363+
const tmpName = path.join(os.tmpdir(), `eclcc-wu-tmp-${crypto.randomBytes(8).toString("hex")}`);
364364
const args = ["-o" + tmpName, "-wu"].concat([filename]);
365365
return this.execFile(this.eclccPath, this.cwd, this.args(args), "eclcc", `Cannot find ${this.eclccPath}`).then((_response: IExecFile) => {
366366
const xmlPath = path.normalize(tmpName + ".xml");

0 commit comments

Comments
 (0)