nix-github-actions
nix-github-actions copied to clipboard
nix-build fails if the name of a check contains a "."
With proper quoting the key part of an attrset can contain a full stop/period/dot character. I use this to name my nixosConfigurations by their corresponding FQDNs. Unfortunately, nix-github-actions does not quote this properly so that the full stop characters are interpreted as separators for nested attrsets instead. You can see the symptoms of this issue e.g. here: https://github.com/matrss/nixfiles/actions/runs/7357559862/job/20029390389.
As it is, nix-github-actions tries to run
nix build -L .#githubActions.checks.x86_64-linux.nelvte.m.0px.xyz
in my case, which obviously fails.
The build would work if the nix build call would look like this:
nix build -L .#githubActions.checks.x86_64-linux.\"nelvte.m.0px.xyz\"
or this:
nix build -L '.#githubActions.checks.x86_64-linux."nelvte.m.0px.xyz"'
i.e. quoting the checks name.
To achieve that, I think mkGithubMatrix should add quotes to the attr values in the matrix json, either unconditionally (because it should not hurt if there are no full stop characters) or when the attr name contains full stops.