mirror of
https://github.com/DeterminateSystems/nix-installer-action.git
synced 2024-12-23 13:32:06 +01:00
Log in to flakehub for 'fh' too (#110)
This commit is contained in:
parent
ab6bcb2d5a
commit
d41fccdd9e
3 changed files with 13 additions and 13 deletions
12
.github/workflows/ci.yml
vendored
12
.github/workflows/ci.yml
vendored
|
@ -128,12 +128,6 @@ jobs:
|
||||||
cat -n /etc/nix/nix.conf
|
cat -n /etc/nix/nix.conf
|
||||||
grep -E "^trusted-users = .*$USER" /etc/nix/nix.conf
|
grep -E "^trusted-users = .*$USER" /etc/nix/nix.conf
|
||||||
grep -E "^use-sqlite-wal = true" /etc/nix/nix.conf
|
grep -E "^use-sqlite-wal = true" /etc/nix/nix.conf
|
||||||
- name: Breakpoint if tests failed
|
|
||||||
if: failure()
|
|
||||||
uses: namespacelabs/breakpoint-action@v0
|
|
||||||
with:
|
|
||||||
duration: 5m
|
|
||||||
authorized-users: grahamc
|
|
||||||
|
|
||||||
install-nix-macos:
|
install-nix-macos:
|
||||||
name: Run test suite for macOS systems
|
name: Run test suite for macOS systems
|
||||||
|
@ -217,12 +211,6 @@ jobs:
|
||||||
cat /etc/nix/nix.conf
|
cat /etc/nix/nix.conf
|
||||||
grep -E "^trusted-users = .*$USER" /etc/nix/nix.conf
|
grep -E "^trusted-users = .*$USER" /etc/nix/nix.conf
|
||||||
grep -E "^use-sqlite-wal = true" /etc/nix/nix.conf
|
grep -E "^use-sqlite-wal = true" /etc/nix/nix.conf
|
||||||
- name: Breakpoint if tests failed
|
|
||||||
if: failure()
|
|
||||||
uses: namespacelabs/breakpoint-action@v0
|
|
||||||
with:
|
|
||||||
duration: 5m
|
|
||||||
authorized-users: grahamc
|
|
||||||
|
|
||||||
install-with-non-default-source-inputs:
|
install-with-non-default-source-inputs:
|
||||||
name: Install Nix using non-default source-${{ matrix.inputs.key }}
|
name: Install Nix using non-default source-${{ matrix.inputs.key }}
|
||||||
|
|
5
dist/index.js
generated
vendored
5
dist/index.js
generated
vendored
|
@ -102316,9 +102316,14 @@ ${stderrBuffer}`
|
||||||
netrcPath,
|
netrcPath,
|
||||||
[
|
[
|
||||||
`machine api.flakehub.com login flakehub password ${jwt}`,
|
`machine api.flakehub.com login flakehub password ${jwt}`,
|
||||||
|
`machine cache.flakehub.com login flakehub password ${jwt}`,
|
||||||
`machine flakehub.com login flakehub password ${jwt}`
|
`machine flakehub.com login flakehub password ${jwt}`
|
||||||
].join("\n")
|
].join("\n")
|
||||||
);
|
);
|
||||||
|
const flakehubAuthDir = `${process.env["XDG_CONFIG_HOME"] || `${process.env["HOME"]}/.config`}/flakehub`;
|
||||||
|
await (0,promises_namespaceObject.mkdir)(flakehubAuthDir, { recursive: true });
|
||||||
|
const flakehubAuthPath = `${flakehubAuthDir}/auth`;
|
||||||
|
await (0,promises_namespaceObject.writeFile)(flakehubAuthPath, jwt);
|
||||||
core.info("Logging in to FlakeHub.");
|
core.info("Logging in to FlakeHub.");
|
||||||
if (this.extraConf?.join("\n").match(/^netrc-file/m)) {
|
if (this.extraConf?.join("\n").match(/^netrc-file/m)) {
|
||||||
core.warning(
|
core.warning(
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import * as actionsCore from "@actions/core";
|
import * as actionsCore from "@actions/core";
|
||||||
import * as github from "@actions/github";
|
import * as github from "@actions/github";
|
||||||
import * as actionsExec from "@actions/exec";
|
import * as actionsExec from "@actions/exec";
|
||||||
import { access, writeFile, readFile } from "node:fs/promises";
|
import { access, writeFile, readFile, mkdir } from "node:fs/promises";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import fs from "node:fs";
|
import fs from "node:fs";
|
||||||
import { userInfo } from "node:os";
|
import { userInfo } from "node:os";
|
||||||
|
@ -854,10 +854,17 @@ class NixInstallerAction extends DetSysAction {
|
||||||
netrcPath,
|
netrcPath,
|
||||||
[
|
[
|
||||||
`machine api.flakehub.com login flakehub password ${jwt}`,
|
`machine api.flakehub.com login flakehub password ${jwt}`,
|
||||||
|
`machine cache.flakehub.com login flakehub password ${jwt}`,
|
||||||
`machine flakehub.com login flakehub password ${jwt}`,
|
`machine flakehub.com login flakehub password ${jwt}`,
|
||||||
].join("\n"),
|
].join("\n"),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const flakehubAuthDir = `${process.env["XDG_CONFIG_HOME"] || `${process.env["HOME"]}/.config`}/flakehub`;
|
||||||
|
await mkdir(flakehubAuthDir, { recursive: true });
|
||||||
|
const flakehubAuthPath = `${flakehubAuthDir}/auth`;
|
||||||
|
|
||||||
|
await writeFile(flakehubAuthPath, jwt);
|
||||||
|
|
||||||
actionsCore.info("Logging in to FlakeHub.");
|
actionsCore.info("Logging in to FlakeHub.");
|
||||||
|
|
||||||
// the join followed by a match on ^... looks silly, but extra_config
|
// the join followed by a match on ^... looks silly, but extra_config
|
||||||
|
|
Loading…
Reference in a new issue