gamedig / rust-gamedig

Game Server Query Library.
https://crates.io/crates/gamedig
MIT License
36 stars 10 forks source link

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

Closed Douile closed 9 months ago

Douile commented 9 months ago

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](https://github.com/gamedig/rust-gamedig/actions/runs/6410213288/job/17403025040?pr=114) ``` 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. (/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: