Skip to content

Commit 2c45c81

Browse files
committed
Add DryRunOption interface
1 parent 5c030f4 commit 2c45c81

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

‎pr-checks/config.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,9 @@ export const API_COMPATIBILITY_FILE = path.join(
3636
SOURCE_ROOT,
3737
"api-compatibility.json",
3838
);
39+
40+
/** A common interface for operations that support dry runs. */
41+
export interface DryRunOption {
42+
/** A value indicating whether to perform operations with side effects. */
43+
dryRun?: boolean;
44+
}

‎pr-checks/update-release-branch.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ import * as fs from "node:fs";
2323
import { parseArgs } from "node:util";
2424

2525
import { type ApiClient, getApiClient } from "./api-client";
26-
import { CHANGELOG_FILE, PACKAGE_JSON, REPO_ROOT } from "./config";
26+
import {
27+
CHANGELOG_FILE,
28+
DryRunOption,
29+
PACKAGE_JSON,
30+
REPO_ROOT,
31+
} from "./config";
2732

2833
/** Placeholder changelog content for a new release. */
2934
const EMPTY_CHANGELOG = `# CodeQL Action Changelog
@@ -70,10 +75,7 @@ export function getGitHubToken(): string {
7075
}
7176

7277
/** Options for {@link runCommand}. */
73-
export interface RunCommandOptions {
74-
/** A value indicating whether to just log the command, rather than run it. */
75-
dryRun?: boolean;
76-
78+
export interface RunCommandOptions extends DryRunOption {
7779
/** Options for `execFileSync`. */
7880
execOptions?: ExecFileSyncOptions;
7981
}
@@ -107,11 +109,9 @@ export function runCommand(
107109
}
108110

109111
/** Options for {@link runGit}. */
110-
export interface RunGitOptions {
112+
export interface RunGitOptions extends DryRunOption {
111113
/** When true, non-zero exit codes will not throw. */
112114
allowNonZeroExitCode?: boolean;
113-
/** A value indicating whether to just log the command, rather than run it. */
114-
dryRun?: boolean;
115115
}
116116

117117
/**

0 commit comments

Comments
 (0)