Skip to content

Commit

Permalink
Log in to flakehub for 'fh' too (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamc committed Jul 26, 2024
1 parent ab6bcb2 commit d41fccd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down
5 changes: 5 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d41fccd

Please sign in to comment.