-
Notifications
You must be signed in to change notification settings - Fork 49
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
fix: fix issue when action run on main #2236
Conversation
Signed-off-by: Jason C. Leach <[email protected]>
Signed-off-by: Jason C. Leach <[email protected]>
end_ref="HEAD" | ||
fi | ||
|
||
change_count=$(git diff --name-only origin/main..${end_ref} | grep -E '^(app/.*)|(.yarn/.*)|(.github/workflows/.*)' | wc -l) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you make origin/main
dynamic? We can use ${GITHUB_BASE_REF:-HEAD}
since GITHUB_BASE_REF
is only provided for PRs, the :-HEAD
will head the default to HEAD
when not from a PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, I had to include origin
otherwise git complains if it being ambitious:
Run # On main branch, compare with the previous
Comparing main with HEAD
fatal: ambiguous argument 'main..HEAD': unknown revision or path not in the working tree.
I also tested origin/HEAD..HEAD^
works.
Signed-off-by: Jason C. Leach <[email protected]>
Signed-off-by: Jason C. Leach <[email protected]>
Signed-off-by: Jason C. Leach <[email protected]>
Signed-off-by: Jason C. Leach <[email protected]>
Signed-off-by: Jason C. Leach <[email protected]>
Signed-off-by: Jason C. Leach <[email protected]>
Quality Gate passedIssues Measures |
When run on main the diff can not be agains the same ref.