summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2026-02-11 23:23:10 +0800
committerruki <[email protected]>2026-02-11 23:23:10 +0800
commit2f944ae3380afc0129baff3f944ce31ed1faf72e (patch)
treebfd5f75a630de9acaab9be7626c2deb9fef04301
parentaaa60e5d6707525cf55e22512d166800367ce0e5 (diff)
format code
-rw-r--r--.github/workflows/dragonflybsd.yml8
1 files changed, 4 insertions, 4 deletions
diff --git a/.github/workflows/dragonflybsd.yml b/.github/workflows/dragonflybsd.yml
index 0a7730bb1..b65a22a88 100644
--- a/.github/workflows/dragonflybsd.yml
+++ b/.github/workflows/dragonflybsd.yml
@@ -19,17 +19,17 @@ jobs:
script: |
const fs = require('fs');
const outputFile = process.env.GITHUB_OUTPUT;
-
+
// Always run for release events
if (context.eventName === 'release') {
fs.appendFileSync(outputFile, `should-run=true\n`);
core.info('Release event detected. Will run tests.');
return;
}
-
+
// Execution probability (default 20%, can be overridden via env)
const probability = parseFloat(process.env.RUN_PROBABILITY || '0.2');
-
+
// Generate deterministic "random" number based on commit SHA, run ID, and current time
// Adding time ensures better randomness while keeping same commit/run consistent
const timeSeed = Math.floor(Date.now() / (1000 * 60 * 60)); // Round to hour for consistency
@@ -43,7 +43,7 @@ jobs:
// Normalize to 0-1 range
const random = Math.abs(hash) / 2147483647;
const shouldRun = random < probability;
-
+
// Use environment file instead of deprecated set-output
fs.appendFileSync(outputFile, `should-run=${shouldRun}\n`);
if (shouldRun) {