Skip to content

atomic push failed for ref refs/heads/... status: 5 #383

@staabm

Description

@staabm

git-auto-commit Version

v6

Machine Type

Ubuntu (eg. ubuntu-latest)

Bug description

a build from 6 hours ago ran into a strange error, after we created some changes and tried to push them back onto a PR

Steps to reproduce

  • create a PR which the code-style job will be triggered on

Tried solutions

we reverted to v5 for now, which still works as expected

Example Workflow

name: Code style

on:
  push:
    branches: [production, main, master]
  pull_request:
    types: [ opened, synchronize, reopened, ready_for_review ]
  repository_dispatch:
    types: [ csfix-command ] # triggered by /csfix PR comment

concurrency:
  group: ecs-${{github.event_name}}-${{ github.head_ref || github.run_id }} 
  cancel-in-progress: true

jobs:
  coding_standard:
    name: Coding Standard
    runs-on: ubuntu-latest

      - uses: actions/checkout@v4
        with:
          token: ${{ secrets.PHP_GH_ACTION }}
          repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
          ref: ${{ github.event.client_payload.pull_request.head.ref }}

  // .. produce some changes to files

      - name: Commit changed files
        if: "github.event_name != 'push'"
        uses: stefanzweifel/git-auto-commit-action@v6
        with:
          commit_message: Apply coding standard changes
          branch: ${{ github.head_ref }}

Relevant log output

Started: bash /home/runner/work/_actions/stefanzweifel/git-auto-commit-action/v6/entrypoint.sh
INPUT_REPOSITORY value: .
INPUT_STATUS_OPTIONS: 
INPUT_FILE_PATTERN: .
INPUT_ADD_OPTIONS: 
INPUT_FILE_PATTERN: .
INPUT_COMMIT_OPTIONS: 
INPUT_COMMIT_USER_NAME: github-actions[bot]
INPUT_COMMIT_USER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
INPUT_COMMIT_MESSAGE: Apply coding standard changes
INPUT_COMMIT_AUTHOR: gh-kundenserver <52193449+gh-kundenserver@users.noreply.github.com>
[detached HEAD 09d9b7b] Apply coding standard changes
 Author: gh-kundenserver <52193449+gh-kundenserver@users.noreply.github.com>
 1 file changed, 6 insertions(+), 7 deletions(-)
INPUT_TAGGING_MESSAGE: 
No tagging message supplied. No tag will be added.
INPUT_BRANCH value: number-portability-admin
INPUT_PUSH_OPTIONS: 
error: atomic push failed for ref refs/heads/number-portability-admin. status: 5
To https://github.com/complex-gmbh/motiontm
 ! [rejected]        HEAD -> number-portability-admin (fetch first)
error: failed to push some refs to 'https://github.com/complex-gmbh/motiontm'
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 status code: 1
    at ChildProcess.<anonymous> (/home/runner/work/_actions/stefanzweifel/git-auto-commit-action/v6/index.js:17:19)
    at ChildProcess.emit (node:events:524:28)
    at maybeClose (node:internal/child_process:1104:16)
    at ChildProcess._handle.onexit (node:internal/child_process:304:5) {
  code: 1
}
Error: Invalid status code: 1
    at ChildProcess.<anonymous> (/home/runner/work/_actions/stefanzweifel/git-auto-commit-action/v6/index.js:17:19)
    at ChildProcess.emit (node:events:524:28)
    at maybeClose (node:internal/child_process:1104:16)
    at ChildProcess._handle.onexit (node:internal/child_process:304:5)

Repository

https://github.com/complex-gmbh/motiontm (private)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions