tj-actions/eslint-changed-files

[Feature] Add Option to Remove Merge Commit

Huzaifa-Asif opened this issue · 2 comments

Is this feature missing in the latest version?

  • I'm using the latest release

Is your feature request related to a problem? Please describe.

If we add an option to remove the merge commit before the eslint changes in the config option it will be very good, as the merge commit pulls changes from the base branch and it is causing a lot of issues in our workflow as we didn't want to do that and sometimes because of this un-necessary features are pulled and cause issue during deployment.

Describe the solution you'd like?

The solution should be adding a boolean variable in GitHub action eslint config where we can turn this on and off.

Describe alternatives you've considered?

No response

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Thanks for reporting this issue, don't forget to star this project if you haven't already to help us reach a wider audience.

Hi @Huzaifa-Asif, the merge commits wouldn’t be coming from this action. Based on testing the reason you are seeing merge commits is as a result of the checkout action merging the base branch and the pull request branch's latest commit.

See: actions/checkout#881

A solution for this would be

- uses: actions/checkout@v4
  with:
    ref: ${{ github.event.pull_request.head.sha }}
    fetch-depth: 0

Mentioned here: https://github.com/actions/checkout/blob/v3.0.2/README.md#user-content-checkout-pull-request-head-commit-instead-of-merge-commit