Skip to content

Commit

Permalink
fix: use more unique working directory
Browse files Browse the repository at this point in the history
RUNNER_TEMP will predictably become a more common place for workflow
users to put stuff on, given that the upcoming examples will make use of
it. Therefore, it's important to use a reproducible but unpredictable
path to avoid messing with data that other steps rely on.

Neither Node nor JavaScript have good features for generating random
constants at build time or managing the built-in PRNG seed, so let's
sidestep potential problems by hardcoding a random 128 bit hex string
that I have just generated, and should be pretty unique.
  • Loading branch information
AlexTMjugador committed Jun 14, 2023
1 parent d2462c1 commit 84dd694
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/cleanup_working_directory/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/main/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/working_directory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class WorkingDirectory {
binaryExtension: string;

constructor() {
this.path = path.join(getEnvOrThrow('RUNNER_TEMP'), 'packsquash');
this.path = path.join(getEnvOrThrow('RUNNER_TEMP'), 'packsquash-1040c4a92c59083e9c206174a4ad7103');
this.binaryExtension = getEnvOrThrow('RUNNER_OS') == 'Windows' ? '.exe' : '';
}

Expand Down

0 comments on commit 84dd694

Please sign in to comment.