Comments (12)
Thanks for the quick turnaround. I confirm that 2.0.10 fixes the issue on my windows runner.
btw, it should be straightforward to add windows runners to the new unit tests, by adding stategy:
and matrix:
levels to the workflow .yml, and with os: [ubuntu-latest, windows-latest]
list:
https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
Perhaps I should PR that.
from setup-git-credentials.
Cool, that saves us a lot of hassle. Thanks for the PR, and thanks again for the reporting, debugging and testing :D
from setup-git-credentials.
Interesting. This looks like it may be a problem with nodejs
on Windows. But maybe we can avoid or fix it on our side. Do you have a full strack trace maybe? That would help a lot.
from setup-git-credentials.
Rerunning the failed action with 'enable debug logging' set doesn't give any more output than posted above
(in fact, the error seems to stop any stacktrace)
This may be useful:
https://developer.ibm.com/blogs/nodejs-15-release-blog/#updated-handling-of-rejections
You can avoid these warning messaging by handling the rejection with a catch block:
new Promise((resolve, reject) => {
reject('error');
}).catch((error) => {});
(A search on the error message has many similar hits, with similar conclusions)
from setup-git-credentials.
The error message Error: EPERM: operation not permitted, ftruncate
implicates lack of permission for the file.truncate
https://github.com/de-vri-es/setup-git-credentials/blob/main/src/main.ts#L30-L31
// Replace the entire file, so it doesn't matter if it ended with a newline before.
file.truncate(0);
from setup-git-credentials.
Found a clue here nodejs/node#3177
I thought that as long as you have the appropriate privileges and the file is opened for writing (not appending), you should be able to truncate it in either direction.
that was the problem. I had the file opened on Windows using "a+".
https://github.com/de-vri-es/setup-git-credentials/blob/main/src/main.ts#L26
const file = await fs.open(`${xdg_config_home()}/git/credentials`, "a+", 0o600);
Try opening with "w"
write permissions?
from setup-git-credentials.
Ah, good point. The truncating was added later, but I forgot to update the file mode. Do you want to submit a PR to fix it? If not, I will fix it hopefully early this week.
Either way, thanks for the report and the additional information. I'm pretty sure you pinpointed the problem :D
from setup-git-credentials.
Thanks; this is a bit out of my wheel house so I'm happy to wait for a fix if and when you try it.
If it works on your cases without regression then I'll test it on my Windows actions and report back.
from setup-git-credentials.
Al-right, that sounds good! Thanks in advance for the testing. It will help a lot, since I don't have access to a windows machine.
from setup-git-credentials.
I've released 2.0.10 which no-longer truncates files, but simply only adds credentials that weren't already present.
Since there's no truncate anymore, I think this will also fix the problem on Windows.
from setup-git-credentials.
Awesome! Thanks for testing.
And a PR to test on windows would be most welcome. I'm also using a few POSIX command line utilities for the tests though, not sure how easy it would be to write that in a cross-platform way.
from setup-git-credentials.
PR #23 sketches a sufficiently cross-platform way - specifying shell: bash
.
The windows runners execute on WSL which should be reasonably cross-platform
(the PR did, however, hit an issue with windows-vs-unix line endings
and we had already encountered the ftruncate difference here).
(In fact, unaware that the default shell is powershell, my github actions were already
running fine on Windows, using mesonbuild to test c++ projects)
from setup-git-credentials.
Related Issues (17)
- xdg_config_home typo HOT 3
- Credentials in some cases are appended without newline HOT 6
- take dollar sign out HOT 2
- v2 tag is not set to the latest tag of the v2.x series HOT 1
- Repository not found : fusion-engineering/setup-git-credentials HOT 4
- Update to Node 16
- Error while using the action HOT 2
- why not release tag v2.0.9 HOT 1
- Node.js 12 actions are deprecated. HOT 1
- Latest changes not applied to the `v2` tag. HOT 1
- Regarding the loading error of action.yaml HOT 10
- Error: Cannot find module '@actions/core' HOT 6
- error: cannot overwrite multiple values with a single value HOT 1
- Credentials are not properly configured and/or propogated HOT 9
- Cannot find module './utils' HOT 1
- Error: cannot overwrite multiple values with a single value when using a self-hosted runner HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from setup-git-credentials.