Skip to content

[CI] Fix obtaining the diff for the pull request #1197

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

Merged
merged 1 commit into from
Feb 26, 2020

Conversation

bader
Copy link
Contributor

@bader bader commented Feb 26, 2020

New commands will fetch 3 commits: merge commit and two parent commits
with the state of the target branch and PR branch.

Signed-off-by: Alexey Bader alexey.bader@intel.com

New commands will fetch 3 commits: merge commit and two parent commits
with the state of the target branch and PR branch.

Signed-off-by: Alexey Bader <alexey.bader@intel.com>

- name: Get clang-format first
run: sudo apt-get install -yqq clang-format-9

- name: Run clang-format for the patch
run: |
git diff -U0 --no-color origin/${{github.base_ref}}...HEAD | ./clang/tools/clang-format/clang-format-diff.py -p1 -binary clang-format-9 > ./clang-format.patch
git diff -U0 --no-color ${GITHUB_SHA}^1 ${GITHUB_SHA} -- | ./clang/tools/clang-format/clang-format-diff.py -p1 -binary clang-format-9 > ./clang-format.patch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I right that this check now processes diff between the last commit in PR and one commit before? What if PR initially contains more than 1 commit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GITHUB_SHA - merge commit for git merge <target branch> <PR branch>.

@bader bader merged commit afff49b into intel:sycl Feb 26, 2020
@bader bader deleted the fix-clang-format-check branch February 26, 2020 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants