Running commands against PR branches

Hello all,

I’m essentially trying to run this command:

git diff my-feature..master | xargs eslint

The only issue I have is I need to make master and my-feature variables based on what is setup in the pull request. So essentially running eslint ONLY on the diff between a PR branch and the branch it is attempting to be merged into.

Any ideas?

1 Like

[EDIT] This does not work for PRs containing multiple commits. CIRCLE_COMPARE_URL refers to diffs introduced by a single git push.

You can follow this idea:

Here is a code example:

#Parsing this variable inside circle ci exports.

#Get Commit Ids Part
for x in $splittedArray
printf "> Build is between commits : $COMMIT_ID_PARTS\n"

(source NameBright - Coming Soon)