Skip to content

Push of formatted code fails with "fatal: You are not currently on a branch." #11

@barbeau

Description

@barbeau

First off, great plugin!

I'm trying to apply it in a new PR here:
https://github.com/MobilityData/gtfs-validator/pull/616/checks?check_run_id=1743823100

It's a really basic config inside an existing workflow file:

  formatting:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2 # v2 minimum required
      - uses: axel-op/googlejavaformat-action@v3

However, it's failing with the following:

...
validator/processor/src/main/java/org/mobilitydata/gtfsvalidator/processor/TableLoaderGenerator.java
Committing changes
  /usr/bin/git commit --all -m Google Java Format
  [detached HEAD 681a617] Google Java Format
   2 files changed, 18 insertions(+), 20 deletions(-)
  /usr/bin/git push
  fatal: You are not currently on a branch.
  To push the history leading to the current (detached HEAD)
  state now, use
  
      git push origin HEAD:<name-of-remote-branch>
  
Error: The command 'git' failed with exit code 128

Am I missing something simple here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions