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
Diff does not distinguish between changes on source and target branch #142
Diff does not distinguish between changes on source and target branch #142
Comments
Hi @kwin! Thanks for reporting. Interesting. So this is because |
Exactly, there are some commits on master which are not on the branch from the PR. Pretty common for feature branches which live a bit longer. |
@kwin I haven't forgotten about this. I simply haven't had the time to dig into the guts of git to figure it out. If you have ideas, I'm welcome to them! |
Actually, I believe I have a fix for this. Was simpler than I anticipated. I'll create a |
I was looking into this and the problem is that the changelog enforcer would need to pull all of the git history (as far as I can tell) to do this diff properly. This might not be the right reason to pull such history. I need to do some thinking about if there is a way to tell if the full history has been downloaded and then changing the |
Can't you use the command outlined in https://stackoverflow.com/a/29810438 ? |
Indeed that is the right approach. But as I said, you need a deeper commit history for it to work. |
Probably switching from git cli to https://docs.github.com/en/rest/reference/repos#commits is required to make it work on shallow clones. |
I think you are right. It's doable, but it will be a significant refactor. I'll aim to put this in a |
Hi @kwin I've got an early release candidate that I believe solves this problem. Could you try that workflow using |
The test release 3.0 does not work. It gives the following error
(https://github.com/Adobe-Consulting-Services/acs-aem-commons/runs/4237701929?check_suite_focus=true) |
Ah, yes. I believe you are missing the additional token that is required for this version. Since the new version uses the GitHub API, it needs an access token. You can use the one auto-generated by GHA.
|
This won't work with PRs from forked repos. Please rather use the token from the
|
You can use any token you want. It's just an argument to the action. |
I don't think there is a good reason to not take the github.token from the context. Less configuration and should always work. Why do you force user's to configure it? |
Maybe it is just the actions I've used, but I've seen many requiring the token to be specified explicitly rather than assumed. It is a good point though. I'll take a look at using the |
Not sure whether the GitHub documentation is actually wrong: https://github.community/t/accessing-gh-context-in-actions/206203/3 and you always need to explicitly pass it as parameter... |
@kwin I've updated that branch to use the |
@dangoslen Can I expect the release 3.0 soon (currently there is only the branch, but no tag and the commits are not on master despite the fact that this issue is closed)? |
Describe the bug
A changelog modification is incorrectly detected if it only exists on the target branch.
To Reproduce
Expected behavior
The changelog enforcer should fail.
** Actual behavior**
The changelog enforcer does not fail.
This is due to the way how the diff is generated which takes into account changes on both sides (source and target branch).
A link to or sample of your workflow
https://github.com/Adobe-Consulting-Services/acs-aem-commons/runs/3352468125?check_suite_focus=true
The text was updated successfully, but these errors were encountered: