13rac1 / block-fixup-merge-action

Github Action to block merge of Pull Requests containing fixup! or squash! commits
MIT License
46 stars 14 forks source link

Question: Works with private repositories? #20

Closed TomerFi closed 3 years ago

TomerFi commented 3 years ago

Hey

Great action!

Is it suppose to work with private repositories? so far I've been getting:

fatal: couldn't find remote ref xx/merge

** xx marks the pr number of course.

13rac1 commented 3 years ago

That's curious. 🤔 Yes, I built this for use originally with private repos. That ref should be ignored. It should only look at head refs AKA branch names.

https://github.com/13rac1/block-fixup-merge-action/blob/6521b8e62ce59799891a2cdbcbcc75b7319b0b35/entrypoint.sh#L8-L11

Do are you using v1.1.2? Can you post the entire logs? Just redact anything you are concerned about. I suspect this is a new non-branch name format, but cannot be sure.

TomerFi commented 3 years ago

Thank you for responding.

I've used version 1.1.1:

- name: Block autosquash commits
  uses: 13rac1/block-fixup-merge-action@v1.1.1

As far as the log goes, in the workflow log I see:

Run 13rac1/block-fixup-merge-action@v1.1.1
/usr/bin/docker run ... ...
...
Current ref: refs/pull/245/merge
Current branch: 45/merge
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0        
From https://github.com/my-org-name/my-repo-name
 * branch            master     -> FETCH_HEAD
fatal: couldn't find remote ref 45/merge

The branch name was better-ci-cd but I've also tried a couple of other test/temp branch names.

I should point out that I've only tried this with a private repository in my company's organization. I don't know if it's related but I can try this again using a private repo in my own profile and not withing an organization.

13rac1 commented 3 years ago

Ah! This issue was fixed in 1.1.2. Please upgrade https://github.com/13rac1/block-fixup-merge-action/releases/tag/v1.1.2