rikhuijzer / cache-install

Use the GitHub Actions cache for Nix packages
MIT License
42 stars 19 forks source link

Action broken after October update disabled `set-env ` #3

Closed tbenst closed 3 years ago

tbenst commented 3 years ago

There was a change to GitHub actions in October that broke this cache-install action: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

Run nix-actions/cache-install@v1.0.6
 Preparing restore 
/home/runner/work/_actions/nix-actions/cache-install/v1.0.6/src/core.sh prepare-restore
mkdir: created directory '/nix'
changed ownership of '/nix' from root:root to runner:docker
 Restoring cache for key: nix-227a755679badd1cf6a3fb8c79d905734ad7986b88e1b140ac468957ff995cd4 
 Cache restored 
 Installing with Nix 
/home/runner/work/_actions/nix-actions/cache-install/v1.0.6/src/core.sh install-with-nix
Error: Unable to process command '::set-env name=NIX_PATH::nixpkgs=channel:nixos-unstable' successfully.
Error: The `set-env` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

A temporary (but unsafe) workaround is as follows:

- name: Cache install Nix packages
  uses: nix-actions/cache-install@v1.0.6
  with:
    key: nix-${{ hashFiles('release.nix') }}
    nix_file: 'default.nix'
  env:
    ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
rikhuijzer commented 3 years ago

Wow, I didn't get notifications for anything happening in this repository. Feel free to ping me or send in a PR. I'll try to fix the action again.