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

fix: Force push git changelogs #36

Merged
merged 1 commit into from
Mar 2, 2023
Merged

fix: Force push git changelogs #36

merged 1 commit into from
Mar 2, 2023

Conversation

SuperQ
Copy link
Contributor

@SuperQ SuperQ commented Mar 2, 2023

We need to use force push to update skipping the default branch protection rules.

We need to use force push to update skipping the default branch
protection rules.

Signed-off-by: SuperQ <superq@gmail.com>
@SuperQ SuperQ requested a review from paulfantom March 2, 2023 12:12
@github-actions github-actions bot added the bugfix label Mar 2, 2023
@paulfantom paulfantom merged commit 0d9737f into main Mar 2, 2023
@paulfantom paulfantom deleted the superq/fix_auto_cl branch March 2, 2023 13:14
@paulfantom
Copy link
Member

Seems like branch protection won't allow pushing at all, even when using --force.

INPUT_PUSH_OPTIONS: --force
remote: error: GH006: Protected branch update failed for refs/heads/main.        
remote: error: Changes must be made through a pull request.        
To https://github.com/prometheus-community/ansible
 ! [remote rejected] HEAD -> main (protected branch hook declined)
error: failed to push some refs to 'https://github.com/prometheus-community/ansible'

@gardar
Copy link
Member

gardar commented Mar 2, 2023

Force pushes to protected branches has to be enabled in the repo settings for that to work.
It's actually in the docs for the action: https://github.com/stefanzweifel/git-auto-commit-action#push-to-protected-branches

@paulfantom
Copy link
Member

@SuperQ could you enable this setting in branch protection? I don't have access :(

@SuperQ
Copy link
Contributor Author

SuperQ commented Mar 2, 2023

How I did it was to add prombot as a "allowed to force push" exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants