forked from lix-project/lix-installer
Action extra conf can be lacking newline (#175)
* Try extra-conf with a heredoc * Test case * Other test case * heredoc in yaml goes burr * use special bash syntax for newline * Correctly close quotes * Remove testing symbols * Use file method * unwhoops jobs
This commit is contained in:
parent
20aa4cdf0b
commit
82ec255060
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
|
@ -346,6 +346,8 @@ jobs:
|
|||
log-directives: nix_installer=trace
|
||||
backtrace: full
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
extra-conf: |
|
||||
trusted-users = root runner
|
||||
- name: Initial uninstall (without a `nix run` first)
|
||||
run: sudo -E /nix/nix-installer uninstall
|
||||
env:
|
||||
|
@ -361,6 +363,7 @@ jobs:
|
|||
log-directives: nix_installer=trace
|
||||
backtrace: full
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
extra-conf: trusted-users = root runner
|
||||
- name: echo $PATH
|
||||
run: echo $PATH
|
||||
- name: Test `nix` with `$GITHUB_PATH`
|
||||
|
|
20
action.yml
20
action.yml
|
@ -115,19 +115,17 @@ runs:
|
|||
echo "Set NIX_INSTALLER_NIX_PACKAGE_URL=$NIX_INSTALLER_NIX_PACKAGE_URL"
|
||||
fi
|
||||
|
||||
export NIX_INSTALLER_EXTRA_CONF_FILE=/tmp/extra-nix-config
|
||||
touch $NIX_INSTALLER_EXTRA_CONF_FILE
|
||||
if [ -n "${{ inputs.extra-conf }}" ]; then
|
||||
if [ -n "${{ inputs.github-token }}" ]; then
|
||||
export NIX_INSTALLER_EXTRA_CONF="${{ inputs.extra-conf }}access-tokens = github.com=${{ inputs.github-token }}"
|
||||
else
|
||||
export NIX_INSTALLER_EXTRA_CONF="${{ inputs.extra-conf }}"
|
||||
fi
|
||||
echo "Set NIX_INSTALLER_EXTRA_CONF=$NIX_INSTALLER_EXTRA_CONF"
|
||||
else
|
||||
if [ -n "${{ inputs.github-token }}" ]; then
|
||||
export NIX_INSTALLER_EXTRA_CONF="access-tokens = github.com=${{ inputs.github-token }}"
|
||||
echo "Set NIX_INSTALLER_EXTRA_CONF=$NIX_INSTALLER_EXTRA_CONF"
|
||||
fi
|
||||
echo "${{ inputs.extra-conf }}" >> $NIX_INSTALLER_EXTRA_CONF_FILE
|
||||
fi
|
||||
if [ -n "${{ inputs.github-token }}" ]; then
|
||||
echo "access-tokens = github.com=${{ inputs.github-token }}" >> $NIX_INSTALLER_EXTRA_CONF_FILE
|
||||
fi
|
||||
|
||||
export NIX_INSTALLER_EXTRA_CONF="$(cat $NIX_INSTALLER_EXTRA_CONF_FILE)"
|
||||
echo "Set NIX_INSTALLER_EXTRA_CONF=$NIX_INSTALLER_EXTRA_CONF"
|
||||
|
||||
if [ -n "${{ inputs.mac-encrypt }}" ]; then
|
||||
export NIX_INSTALLER_ENCRYPT=${{ inputs.mac-encrypt }}
|
||||
|
|
Loading…
Reference in a new issue