Skip to content

Windows tar cannot overwrite read-only files #479

Description

@mzabaluev

Describe the bug
C:\Windows\System32\tar.exe fails when an archive extraction needs to overwrite existing files with the read-only attribute. This creates problems in the cache action: actions/cache#198

To Reproduce
Trigger this GitHub workflow two times:

on: pushjobs:
test:
runs-on: windows-lateststeps:
- uses: actions/checkout@v2
- name: List read-only filesrun: Get-ChildItem .git -Recurse -Attributes ReadOnly
- uses: actions/cache@v2with:
key: break-mepath: .git

The cache action fails on the second run, with tar reporting "Can't unlink already-existing object" errors referring to the read-only files.

Expected behavior

On the second run, the cache action should restore from the key with no errors.

Additional context
The system tar is selected in preference to GNU tar, which works as expected when --force-local option is used. GNU tar is installed in the Windows virtual environment as part of the Git toolkit and its full path name is "C:\Program Files\Git\usr\bin\tar.exe".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcache

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions