Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/actions/nix-install-ephemeral/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,19 @@ runs:
using: composite
steps:
- name: validate push-to-cache required inputs
if: inputs.push-to-cache == true
if: inputs.push-to-cache == 'true'
shell: bash
run: |
abort() { echo "$@" >&2; exit 1; }
[[ -z "${{ inputs.nix-signing-key}}" ]] && abort "nix-signing-key is required when push-to-cache is true"
[[ -z "${{ inputs.role-to-assume}}" ]] && abort "role-to-assume is required when push-to-cache is true"
[[ -n ${NIX_SIGNING_KEY:+ok} ]] || abort "nix-signing-key is required when push-to-cache is true"
[[ -n ${ROLE_TO_ASSUME:+ok} ]] || abort "role-to-assume is required when push-to-cache is true"
env:
NIX_SIGNING_KEY: ${{ inputs.nix-signing-key }}
ROLE_TO_ASSUME: ${{ inputs.role-to-assume }}

- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
if: inputs.push-to-cache == true
if: inputs.push-to-cache == 'true'
with:
role-to-assume: ${{ inputs.role-to-assume }}
aws-region: ${{ inputs.aws-region }}
Expand All @@ -42,7 +45,7 @@ runs:
AWS_REGION: ${{ inputs.aws-region }}
GITHUB_TOKEN: ${{ github.token }}
NIX_SIGN_SECRET_KEY: ${{ inputs.nix-signing-key }}
PUSH_TO_CACHE: ${{ inputs.push-to-cache == true }}
PUSH_TO_CACHE: ${{ inputs.push-to-cache == 'true' }}

- name: verify nix in path
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/nix-install-ephemeral/setup-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ cat >"$NIXCONFDIR/upload-to-cache.sh" <<-EOF
export IFS=' '
echo $NIXBINDIR/nix copy --max-jobs 5 --to 's3://nix-postgres-artifacts?secret-key=$NIXCONFDIR/nix-secret-key' \$OUT_PATHS
EOF
chmod o+x "$NIXCONFDIR/upload-to-cache.sh"
chmod 755 "$NIXCONFDIR/upload-to-cache.sh"

echo "post-build-hook = $NIXCONFDIR/upload-to-cache.sh"
Loading