TriPSs / conventional-changelog-action

Github Action that generates a changelog with the Conventional Changelog CLI
MIT License
298 stars 104 forks source link

Force push #264

Open Simranpal-Bainee opened 5 months ago

Simranpal-Bainee commented 5 months ago

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 commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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 commented 1 month ago

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/checkout@v4.1.7
        with:
          token: ${{ secrets.USER_TOKEN }} # adding this fixed the issue.

      - name: Changelog
         uses: TriPSs/conventional-changelog-action@v5.3.0 # v5

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