Comments (6)
I believe you are correct, using -f to force update the local refs would (or at least could) result comparing to a wrong commit. I did quick test locally that if I force update tag locally, then push it to origin and then try to update tags it will say that would clobber existing tag, even though after force pull tags the commit still points to the exact same commit. So it can be that the commit would be correct, but if the tag would have been previously force updated from another clone then I believe using -f would result in comparing to wrong commit.
So to summarize I tested this without the workaround and it works now and afaik it works exactly as it should. Will let you know if we discover a case where this ain't true, but so far looks really good. So thanks for fixing these issues! This is really useful action for us.
from paths-filter.
Yes you are right. Thanks for reporting the issue. I will try to fix it asap.
from paths-filter.
Thanks for the quick fix, however small issue remains. The finding merge base errors out with: Error: The process '/usr/bin/git' failed with exit code 1
Searching for merge-base dev-deploy...dev-release
/usr/bin/git show-ref dev-deploy
/usr/bin/git fetch --no-tags --depth=100 origin dev-deploy dev-release
From https://github.com/***
* tag dev-deploy -> FETCH_HEAD
* tag dev-release -> FETCH_HEAD
/usr/bin/git show-ref dev-deploy
/usr/bin/git fetch --tags --depth=1 origin dev-deploy dev-release
From https://github.com/***
* tag dev-deploy -> FETCH_HEAD
* tag dev-release -> FETCH_HEAD
* [new tag] dev-deploy -> dev-deploy
! [rejected] dev-release -> dev-release (would clobber existing tag)
* [new tag] stage-release -> stage-release
* [new tag] test-release -> test-release
* [new tag] v1.0.0 -> v1.0.0
* [new tag] v2.0.0 -> v2.0.0
* [new tag] v2.0.0-1 -> v2.0.0-1
Error: The process '/usr/bin/git' failed with exit code 1
As a workaround we added running of the 'git fetch --tags --depth=1 origin dev-deploy dev-release' in previous step and ignored the none zero exit code, this way the paths-filter step won't error out and works as it should with tag as a base. With this workaround the output of searching for merge-base step is:
Searching for merge-base dev-deploy...dev-release
/usr/bin/git show-ref dev-deploy
9df32659538ce5ddf1d475c42b17156db3a08c98 refs/tags/dev-deploy
/usr/bin/git merge-base refs/tags/dev-deploy dev-release
/usr/bin/git fetch --no-tags --depth=100 origin dev-deploy dev-release
From https://github.com/***
* tag dev-deploy -> FETCH_HEAD
* tag dev-release -> FETCH_HEAD
/usr/bin/git rev-list --count --all
212
/usr/bin/git merge-base refs/tags/dev-deploy dev-release
9df32659538ce5ddf1d475c42b17156db3a08c98
from paths-filter.
I see that not only your base is a tag but also a current ref is a tag. That's scenario I must admit I didn't test. I will add it to the list.
Anyway from the logs it seems it would normally work.
However in your case you already had dev-release
tag locally, just pointing to different commit.
That's where the (would clobber existing tag)
error probably comes from.
Adding -f
argument to git fetch
should do the trick.
I will look into it during this weekend.
from paths-filter.
Yes in this particular case thats correct that both are tags did not realize to mention that (nor test the normal case) in the issue since the original flaw was clearly related to the tag as a base. Anyway it seems to work correctly with the workaround, so most likely your assumption would be the correct fix. Thank you for looking into this!
from paths-filter.
Would be possible that your dev-release
tag was updated somewhere between your workflow being triggered and paths-filter being executed? I tested few scenarios and this seems to be the only way how to get error: ! [rejected] dev-release -> dev-release (would clobber existing tag)
.
Originally I thought I will add -f
switch to force update local refs but that would cause change detection against different commit than one your workflow was triggered with.
I think this error can be safely ignored.
I just updated the v2
branch - it will ignore the error and continue as usual.
Could you please remove your workaround and test if it works for you now ?
from paths-filter.
Related Issues (20)
- set-output deprecation warning HOT 1
- Document usage in a merge queue
- How to get intuitive usage when mixing file paths and ignore paths? HOT 3
- Changes are compared against incorrect branch HOT 1
- How to use exclude function HOT 3
- How to use paths-filter in reusable github action workflows HOT 5
- dorny/paths-filter@v2 filter condition returns false with Matching files: none
- Passing output from Githubaction to Terragrunt Githubaction
- Import filters file from another repository HOT 1
- Bug: Filter Action reading files from wrong PR HOT 2
- Feature request: Only perform a checkout when it is required for paths-filter to operate.
- [Feature request] Return as changed array HOT 1
- Exclude few folders in one filter HOT 3
- Detecting changes against main branch on main branch merge? HOT 2
- Become 'Verified creator' on GitHub Marketplace HOT 3
- Token clarification
- Override option to set all Filters to true HOT 2
- Changed files with git commands detects too many files
- Is it possible to check if a single folder has changed? HOT 2
- filter in folder changes does not seem to work HOT 1
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 paths-filter.