Log in to flakehub for 'fh' too (#110)

This commit is contained in:
Graham Christensen 2024-07-26 16:53:16 -04:00 committed by GitHub
parent ab6bcb2d5a
commit d41fccdd9e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 13 deletions

View File

@ -128,12 +128,6 @@ jobs:
cat -n /etc/nix/nix.conf
grep -E "^trusted-users = .*$USER" /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:
name: Run test suite for macOS systems
@ -217,12 +211,6 @@ jobs:
cat /etc/nix/nix.conf
grep -E "^trusted-users = .*$USER" /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:
name: Install Nix using non-default source-${{ matrix.inputs.key }}

5
dist/index.js generated vendored
View File

@ -102316,9 +102316,14 @@ ${stderrBuffer}`
netrcPath,
[
`machine api.flakehub.com login flakehub password ${jwt}`,
`machine cache.flakehub.com login flakehub password ${jwt}`,
`machine flakehub.com login flakehub password ${jwt}`
].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.");
if (this.extraConf?.join("\n").match(/^netrc-file/m)) {
core.warning(

View File

@ -1,7 +1,7 @@
import * as actionsCore from "@actions/core";
import * as github from "@actions/github";
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 fs from "node:fs";
import { userInfo } from "node:os";
@ -854,10 +854,17 @@ class NixInstallerAction extends DetSysAction {
netrcPath,
[
`machine api.flakehub.com login flakehub password ${jwt}`,
`machine cache.flakehub.com login flakehub password ${jwt}`,
`machine flakehub.com login flakehub password ${jwt}`,
].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.");
// the join followed by a match on ^... looks silly, but extra_config