Skip to content
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

Force push #264

Open
Simranpal-Bainee opened this issue Jun 12, 2024 · 4 comments
Open

Force push #264

Simranpal-Bainee opened this issue Jun 12, 2024 · 4 comments

Comments

@Simranpal-Bainee
Copy link

Required to have force push option,
If we have main branch with protection rule that no one else can directly push to branch so force push can help there for allowing to push code from workflow actions

@rgoomar
Copy link

rgoomar commented Jul 12, 2024

I'm also running into a similar problem where we can't setup branch protections without breaking the use of this action. Is there a way to circumvent that issue?

@TriPSs
Copy link
Owner

TriPSs commented Jul 15, 2024

You can change the user that is used when committing, maybe add your own info/user there and configure that user to allow bypassing the checks.

There is also a medium post: https://medium.com/swlh/bump-bump-bump-d0dab616e83

@Simranpal-Bainee
Copy link
Author

Simranpal-Bainee commented Jul 19, 2024

tried both, adding username, email of repo admin and also using token as mentioned in Medium post,
But still getting same error as:

! [remote rejected] test -> test (protected branch hook declined)

@vinay-20
Copy link

vinay-20 commented Oct 7, 2024

I was able to fix this issue by also adding the token in the checkout step which is a precursor step in my case before using this action.

      - uses: actions/[email protected]
        with:
          token: ${{ secrets.USER_TOKEN }} # adding this fixed the issue.

      - name: Changelog
         uses: TriPSs/[email protected] # v5

P.S ; Along with the above change you will still have to setup new github user, create the PAT & provide neccessary permissions..

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

No branches or pull requests

4 participants