[Bug Report]: Issues with publishing logic using git diff
Describe the bug
the pipeline uses git diff to identify if there are files changed within a module and use this logic to identify if it should be published or ignored.
When the 1st attempt to publish failed for whatever reason. after failed attempt, if another unrelated update has merged into the branch, the Get-ModulesToPublish.ps1 script will detect nothing has changed for the module you had problem publishing initially, and you will not be able to publish it again without making any changes to the module, although the previous publishing attempt failed.
There should be an AlwaysPublish option so we can tell the pipeline to always publish, regardless if there are any changes to the module files between current and the previous commit.
cc @ahmadabdalla
To reproduce
- Update module A and commit it to main branch
- The module A pipeline kicks off automatically but failed (or manually stopped) so the module did not get published.
- Update module B and commit the change to main branch
- Manually run module A pipeline again because the previous run did not publish the module
- The 2nd attempt in module A pipeline skips the publishing because no changes are detected for module A
Code snippet
N/A
Relevant log output
N/A
Adding context: Just looking at a PR that was merged quite a while back that addresses something similar: https://github.com/Azure/ResourceModules/pull/2410 in response to https://github.com/Azure/ResourceModules/issues/2153
Tagging https://github.com/Azure/ResourceModules/issues/2896 for reference