Skip to content

Commit 58e64ed

Browse files
authored
Add summary toggle option (#217)
1 parent 1e3c5df commit 58e64ed

File tree

4 files changed

+24
-12
lines changed

4 files changed

+24
-12
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ Differing from the upstream [Nix](https://github.com/NixOS/nix) installer script
132132
| `reinstall` | Force a reinstall if an existing installation is detected (consider backing up `/nix/store`) | Boolean | `false` |
133133
| `start-daemon` | If the daemon should be started, requires `planner: linux-multi` | Boolean | `false` |
134134
| `trust-runner-user` | Whether to make the runner user trusted by the Nix daemon | Boolean | `true` |
135+
| `summarize` | Whether to add a build summary and timeline chart to the GitHub job summary | Boolean | `true` |
135136
| `diagnostic-endpoint` | Diagnostic endpoint url where the installer sends install [diagnostic reports](https://github.com/DeterminateSystems/nix-installer#diagnostics) to, to disable set this to an empty string | string | `https://install.determinate.systems/nix-installer/diagnostic` |
136137
| `proxy` | The proxy to use (if any), valid proxy bases are `https://$URL`, `http://$URL` and `socks5://$URL` | string | |
137138
| `ssl-cert-file` | An SSL cert to use (if any), used for fetching Nix and sets `NIX_SSL_CERT_FILE` for Nix | string | |

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ inputs:
126126
trust-runner-user:
127127
description: Whether to make the runner user trusted by the Nix daemon
128128
default: true
129+
summarize:
130+
description: Whether to add a build summary and timeline chart to the GitHub job summary
131+
default: true
129132
nix-installer-branch:
130133
description: (deprecated) The branch of `nix-installer` to use (conflicts with `nix-installer-tag`, `nix-installer-revision`, `nix-installer-pr`)
131134
required: false

dist/index.js

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

src/index.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ class NixInstallerAction extends DetSysAction {
8888
startDaemon: boolean;
8989
trustRunnerUser: boolean;
9090
runnerOs: string | undefined;
91+
summarize: boolean;
9192

9293
constructor() {
9394
if (platform.getArchOs() === "X64-macOS") {
@@ -152,6 +153,7 @@ class NixInstallerAction extends DetSysAction {
152153
this.reinstall = inputs.getBool("reinstall");
153154
this.startDaemon = inputs.getBool("start-daemon");
154155
this.trustRunnerUser = inputs.getBool("trust-runner-user");
156+
this.summarize = inputs.getBool("summarize");
155157
this.runnerOs = process.env["RUNNER_OS"];
156158
}
157159

@@ -164,12 +166,14 @@ class NixInstallerAction extends DetSysAction {
164166

165167
async post(): Promise<void> {
166168
await this.annotateMismatches();
167-
try {
168-
await this.summarizeExecution();
169-
} catch (err: unknown) {
170-
this.recordEvent("summarize-execution:error", {
171-
exception: stringifyError(err),
172-
});
169+
if (this.summarize) {
170+
try {
171+
await this.summarizeExecution();
172+
} catch (err: unknown) {
173+
this.recordEvent("summarize-execution:error", {
174+
exception: stringifyError(err),
175+
});
176+
}
173177
}
174178
await this.cleanupNoSystemd();
175179
await this.reportOverall();

0 commit comments

Comments
 (0)