install-action: Support for idempotent installs/only install if missing?

This doesn’t have any support for not reinstalling each time run does it? When working on my action I was inspired by your action@command usage, so I have a zolacti.on@check and build that are run independently, and each installs zola if needed. I hacked in a quick

    - name: check and store install state of zola for idempotency
      shell: bash
      run: |
        if command -v zola > /dev/null 2>&1; then
            echo "zola_installed=true" >> $GITHUB_ENV
        fi
    - name: Install zola
      if:  true && ! env.zola_installed
      uses: taiki-e/install-action@zola

but I’ll probably expand it to store the version instead of true, so I can pass that down to your script. But really at this point I’m just wrapping your install with my own with a check, and it made me wonder if I missed something in your action.

If not, any interested in adding it? I’ll try and see if I can make a PR if so.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 19 (11 by maintainers)

Most upvoted comments

The checksum is for the archive, not the binary. Anyway, I think it will be slower than just calling version command.