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

[CI] Badge action always pushes to main branch #115

Closed
Douile opened this issue Oct 4, 2023 · 0 comments · Fixed by #116
Closed

[CI] Badge action always pushes to main branch #115

Douile opened this issue Oct 4, 2023 · 0 comments · Fixed by #116
Labels
bug Something isn't working

Comments

@Douile
Copy link
Collaborator

Douile commented Oct 4, 2023

Describe the bug
The badge update action always tries to push the new badge to the main (repo's default) branch, this will fail for PRs as they are on a different branch.

Expected behavior
When the badge should be updated in a PR it should add the commit to that PR, and the action should never result in an error.

Solution
We need to specify which branch to push to like in this example.

Additional context

Push error from action logs

Run ad-m/github-push-action@master
Push to branch main
error: atomic push failed for ref refs/heads/main. status: 5

fatal: protocol error: bad line length character: erro
To https://github.com/gamedig/rust-gamedig.git
 ! [rejected]        HEAD -> main (fetch first)
error: failed to push some refs to 'https://github.com/gamedig/rust-gamedig.git'
hint: Updates were rejected because the remote contains work that you do not
hint: have locally. This is usually caused by another repository pushing to
hint: the same ref. If you want to integrate the remote changes, use
hint: 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Error: Invalid exit code: 1
    at ChildProcess.<anonymous> (/home/runner/work/_actions/ad-m/github-push-action/master/start.js:30:21)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5) {
  code: 1
}

Seen in:

@Douile Douile added the bug Something isn't working label Oct 4, 2023
Douile added a commit to Douile/rust-gamedig that referenced this issue Oct 4, 2023
CosminPerRam pushed a commit that referenced this issue Oct 5, 2023
* [CI] Specify the branch name when pushing node badge commits

Fixes #115

* testing: remove games to update badge

* Add/Update badge

* Revert "testing: remove games to update badge"

This reverts commit 8256176.

* Add/Update badge

---------

Co-authored-by: GitHub Action <action@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant