Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --overwrite flag to tar extraction #156

Merged
merged 5 commits into from
Feb 23, 2021
Merged

Add --overwrite flag to tar extraction #156

merged 5 commits into from
Feb 23, 2021

Conversation

stmcginnis
Copy link
Contributor

There are times when previous actions have already extracted at least
some files to the cache location. This results in subsequent cache
extraction operations to emit errors such as:

/usr/bin/tar: [dest_file_path]: Cannot open: File exists

This adds the --overwrite flag to the extract call to force tar to
just overwrite these files rather than reporting errors.

This is a somewhat naive attempt to address #135

Copy link
Member

@SVilgelm SVilgelm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stmcginnis sorry for the late response
Thank you this is very needed, but could you please make the changes in src folder,
the dist folder should be generated (npm run all)

@stmcginnis
Copy link
Contributor Author

Thanks, still learning how things are laid out. Thanks for the pointer!

I think I have it now, but please let me know if I'm missing anything. Update coming shortly.

There are times when previous actions have already extracted at least
some files to the cache location. This results in subsequent cache
extraction operations to emit errors such as:

> /usr/bin/tar: [dest_file_path]: Cannot open: File exists

This adds the --overwrite flag to the extract call to force tar to
just overwrite these files rather than reporting errors.

Signed-off-by: Sean McGinnis <[email protected]>
@stmcginnis
Copy link
Contributor Author

Another approach may be to try to get something added to https://github.com/actions/toolkit/blob/main/packages/tool-cache/src/tool-cache.ts

dist/post_run/index.js Outdated Show resolved Hide resolved
@SVilgelm
Copy link
Member

@stmcginnis I merged the master branch and run formation and linter on this PR

@stmcginnis
Copy link
Contributor Author

Thanks @SVilgelm!

I think there are issues with this approach due to running on different platforms with different versions of tar. I've submitted actions/toolkit#717 to try to address this in a different way.

Will wait to close this out to see how things go with that PR. Shouldn't need additional follow up here, but will see if that is needed. Maybe to update dependency once/if a new version of that dependency needs to be picked up.

@SVilgelm
Copy link
Member

@stmcginnis Could you please test it and merge if it works fine? I pushed some changes to this PR to ignore macOS platform, I tested on my laptop and the tar overrides the files

@stmcginnis
Copy link
Contributor Author

Thanks, this looks like it does it! I don't appear to have the ability to merge though.

@SVilgelm
Copy link
Member

ok, np, I will merge and bump a new version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1.33.0: "File exists" errors when un-taring golangci-lint
3 participants