Wandalen / wretry.action

Retry action for Github CI
MIT License
98 stars 22 forks source link

Add support for action subdirectories #81

Closed ValentinLevitov closed 1 year ago

ValentinLevitov commented 1 year ago

At present action subdirectories are not supported. For example, there is action https://github.com/actions/cache. And there is an example of actions/cache/restore usage:

    - name: Restore cached Primes
      id: cache-primes-restore
      uses: actions/cache/restore@v3
      with:
        path: |
          path/to/dependencies
          some/other/dependencies
        key: ${{ runner.os }}-primes

It works well until I wrap it around with Wandalen/wretry.action:

jobs:
  local-simple:
    runs-on: ubuntu-latest
    steps:
    - name: Restore Cache
      uses: Wandalen/wretry.action@master
      id: restore
      with:
        action: actions/cache/restore@v3
        with: |
          path: |
            node_modules.tar.zst
            yarn.tar.gz
          key: dependencies-cache-${{ hashFiles('**/yarn.lock') }}
        attempt_limit: 3
        attempt_delay: 60000

This run gives me an error

[local/local-simple]   ❗  ::error::Process returned exit code 128%0ALaunched as "git clone https://github.com/actions/cache/restore . --config core.autocrlf=false"%0ALaunched at "/run/act/cache"%0A-> Stderr%0A-  Cloning into '.'...%0A-  remote: Not Found%0A-  fatal: repository 'https://github.com/actions/cache/restore/' not found%0A-   '%0A-< Stderr

So, it tries to clone repo actions/cache/restore which is absent. There is repo actions/cache with subdirectory 'restore'

dmvict commented 1 year ago

Hello, @ValentinLevitov

Thank you for the report. I will solve the issue when I will have time.

dmvict commented 1 year ago

Hello, @ValentinLevitov

The feature in https://github.com/Wandalen/wretry.action/pull/99. I will notice when the feature will be published.

dmvict commented 1 year ago

Hello, @ValentinLevitov

The new version is released. Please, try it and give me a feedback.

tho93 commented 1 year ago

@dmvict Any docs on how to use the action with subdirectories?

dmvict commented 1 year ago

@tho93 Use the feature similar to @ValentinLevitov code sample:

    - name: Restore Cache
      uses: Wandalen/wretry.action@master
      id: restore
      with:
        action: actions/cache/restore@v3
        with: |
          path: |
            node_modules.tar.zst
            yarn.tar.gz
          key: dependencies-cache-${{ hashFiles('**/yarn.lock') }}
        attempt_limit: 3
        attempt_delay: 60000

I mean that you need to extend action path from author/repo@tag to autor/repo/subdirectory@tag.

Please, notice that local actions are unsupported.